Tag: 背景

如何动画动画列表在Kotlin?

我有一个drawables的animation list XML : <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:duration="40" android:drawable="@drawable/animated_person_0 /> <item android:duration="40" android:drawable="@drawable/animated_person_1 /> <item android:duration="40" android:drawable="@drawable/animated_person_2 /> </animated-list> 我从我的content_main.xml调用了这个list : <ImageView … android:id="@+id/animatedPerson" android:src="@drawable/animatedperson" … /> 现在无论我用我的代码尝试,我无法启动动画。

我想在用kotlin单击Android中的按钮后更改背景

我想单击按钮后更改背景 var bm : Button = messeg bm . setOnClickListener { bm . background = R.color.green } 错误日志: 错误:(35,31)类型不匹配:推断类型是Int,但可绘制! 预期错误:任务':app:compileDebugKotlin'的执行失败。 编译错误。 查看日志了解更多详情

在kotlin android中可以使活动布局的背景变得透明吗?

我下载了github repo代码: https : //github.com/SimpleMobileTools/Simple-Calendar这是写在kotlin android,在这个项目中,我的要求是使我的一个活动的背景透明,但我仍然没有达到。