小编Bri*_*fol的帖子

如何在按下按钮时更改颜色?

我对android编程有点新意,所以我真的不知道自己在做什么.按下时我想按一下按钮改变颜色.到目前为止,这是我的按钮的样子:

<Button
    android:id="@+id/c1"
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:background="#FFFFFF" >

</Button>
Run Code Online (Sandbox Code Playgroud)

我需要添加什么才能在按下时改变颜色?

xml android colors button

1
推荐指数
1
解决办法
639
查看次数

标签 统计

android ×1

button ×1

colors ×1

xml ×1