我是靠谱客的博主 大胆保温杯,这篇文章主要介绍Android中自定义TextView的样式,现在分享给大家,希望可以做个参考。

Android自定义TextView的样式,改变背景颜色,边框粗细和颜色,角的弧度等

 

在res/drawable文件夹下新建一个dd.xml文件,建一个shap,在里面添加需要改变的内容

<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文件

<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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(109)

评论列表共有 0 条评论

立即
投稿
返回
顶部