xml - 如何使背景图像缓慢向上移动
问题描述
我正在使用 Android Studio、Kotlin,我的活动文件是用 xml 编码的。
我希望我的应用程序中的背景慢慢向上移动。
https://youtu.be/_mg5WrvZr3g?t=26
^ 类似这样,但只有一层移动。
这就是我在我的活动 xml 文件中设置背景图像的方式:
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background01tilable"
tools:context=".MainActivity">
这就是我为图像绘制的样子:
<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/background01"
android:tileMode="repeat"
android:scaleType="center"
android:layout_width="10dp"
android:layout_height="50dp"
/>
我将如何制作缓慢移动的背景图像?
解决方案
推荐阅读
- java - 无法更改标签和按钮值
- php - PHP 新手,需要忽略函数中的部分变量
- javascript - 如何用中间省略号截断反应元素中溢出的文本?
- flutter - 颤振:垂直中心柱
- elixir - Ecto 查询 testA 和 (testB 或 testC) 的位置
- mongoose - 在 deepSleep 之后 Mongoose 似乎没有发布
- android - android什么时候从内存中释放对象以及如何处理?
- javascript - 使用 javascript 打开和关闭用户点击时的联系表单
- typescript - 如何为构造函数上的静态属性定义类型
- python - Python FLASHTEXT 在重复的情况下仅返回最后一个键 - 我需要找到所有匹配的情况