Android(安卓)button设置height后圆角消失问题
16lz
2021-12-04
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- pressed --> <item android:state_pressed="true" > <shape android:shape="rectangle"> <gradient android:startColor="#ff8c00" android:endColor="#ff8c00" android:angle="270" /> <corners android:radius="4dp" /> </shape> </item> <!-- focus --> <item android:state_focused="true" > <shape> <gradient android:startColor="#ffc2b7" android:endColor="#ffc2b7" android:angle="270" /> <corners android:radius="4dp" /> </shape> </item> </selector>然后在button的定义中加上:android:background="@drawable/button_selector_gradient"(button_selector_gradient是上述xml文件的文件名称)
更多相关文章
- Android中的searchView去掉前面的搜索圈
- Android(安卓)JNI打印信息
- Android平板电脑不能全屏显示的问题
- 使用Xutils的时候rg.apache.http.client.methods.HttpRequestBas
- android ICS4.0.3去掉相机全景模式
- android 用VideoView播放本地视频文件
- Android实现对HOME键的捕获和屏蔽
- android-EditText输入框被键盘遮挡问题解决方案
- Android开发7:单元测试