mft按钮设计_android > 按钮Button 按下效果 - 大风 - ITeye博客

************** 按下 更改 背景颜色 ********************

*************** 带图片的  *******

先是准备 背景素材,命名规则为

***_normal.9.png   正常状况

***_pressed.9.png   按下状况

附近附带若干窗口图片

然后 drawable 新建 样式 xml

btn_style_alert_dialog_button.xml

xmlns:android="http://schemas.android.com/apk/res/android">

可圆角样式

xmlns:android="http://schemas.android.com/apk/res/android">

xmlns:android="http://schemas.android.com/apk/res/android">

如果要增加边框 在 shape 里 加

其中@color 在res/values/strings.xml

#2D3238

#3C4049

然后在 Button 中的background 中 加载 样式

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="vertical" >

android:id="@+id/btn_take_photo"

android:layout_marginLeft="20dip"

android:layout_marginRight="20dip"

android:layout_marginTop="20dip"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="拍照"

android:background="@drawable/btn_style_alert_dialog_button"

android:textStyle="bold"

/>

e9d247c7269b28db8cb2beff86926963.png

**  android 按钮按下时改变字体颜色

1.新建 drawable/button_font_style.xml

2.添加至需要的xml里

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值