
是否可以在textvIEw周围绘制边框?
解决方法:
您可以将形状可绘制(矩形)设置为视图的背景.
<TextVIEw androID:text="Some text" androID:background="@drawable/back"/>和矩形drawable back.xml(放入res / drawable文件夹):
<shape xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:shape="rectangle" > <solID androID:color="@androID:color/white" /> <stroke androID:wIDth="1dip" androID:color="#4fa5d5"/></shape>您可以使用@androID:color / transparent作为纯色,以获得透明背景.
您还可以使用填充来将文本与边框分开.
有关更多信息,请参阅:http://developer.android.com/guide/topics/resources/drawable-resource.html
以上是内存溢出为你收集整理的如何在Android文本视图周围添加边框?全部内容,希望文章能够帮你解决如何在Android文本视图周围添加边框?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)