Android自定义TextView的样式,改变背景颜色,边框粗细和颜色,角的弧度等
在res/drawable文件夹下新建一个dd.xml文件,建一个shap,在里面添加需要改变的内容
复制代码
1
2
3
4
5
6
7
8
9<shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#ef0909"></solid>//设置背景色 <stroke android:width="1px" android:color="#06ef21"></stroke>//设置边框属性 </shap
在布局文件中有控件引用刚才定义的xml文件
复制代码
1
2
3
4
5
6
7<TextView android:id="@+id/te" android:layout_width="300px" android:layout_height="100px" android:layout_marginTop="50px" android:background="@drawable/dd" />
转载于:https://www.cnblogs.com/lyd447113735/p/8213302.html
最后
以上就是大胆保温杯最近收集整理的关于Android中自定义TextView的样式的全部内容,更多相关Android中自定义TextView内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复