Android--为TextView添加边框
2012-11-27 20:37
393 查看
方法一:
比较土 ,加背景图片,透明的带边框的背景图片
设置到android:background就可以
方法二:
刚学到的
android:background的值是一个xml文件
yle="font-family: mceinline;">TextView的xml:
<TextView android:id="@+id/roomInfo"
android:layout_centerHorizontal="true"
android:textSize="24dip"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignParentRight="true"
android:textColor="@color/solid_black"
android:background="@drawable/setbar_bg"
android:layout_marginLeft="10dip"
android:layout_marginTop="5dip"
android:layout_width="300dip">
</TextView>
setbar_bg.xml 放在drawable-hdpi文件夹下面
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#00000000"/>
<stroke android:width="2dip" android:color="#ff000000" />
</shape>
比较土 ,加背景图片,透明的带边框的背景图片
设置到android:background就可以
方法二:
刚学到的
android:background的值是一个xml文件
yle="font-family: mceinline;">TextView的xml:
<TextView android:id="@+id/roomInfo"
android:layout_centerHorizontal="true"
android:textSize="24dip"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignParentRight="true"
android:textColor="@color/solid_black"
android:background="@drawable/setbar_bg"
android:layout_marginLeft="10dip"
android:layout_marginTop="5dip"
android:layout_width="300dip">
</TextView>
setbar_bg.xml 放在drawable-hdpi文件夹下面
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#00000000"/>
<stroke android:width="2dip" android:color="#ff000000" />
</shape>
相关文章推荐
- android textView添加不同颜色的边框
- android 为TextView添加边框
- android 为TextView添加边框
- android 为TextView添加边框
- Android--为TextView添加边框
- android里TextView加下划线的几种方式 以及 为TextView添加边框 4000
- android 为TextView添加边框
- android 为TextView添加边框
- android 为TextView添加边框
- Android 为TextView 添加边框
- Android TextView边框和背景,以及圆形背景
- Android开发:TextView添加超链接的简便方法
- Android: TextView with border 带边框的TextView Border
- Android TextView 添加滚动条
- Android供TextView添加多个点击文字
- android textview 添加text.放不下自动换行
- Android给TextView,EditText等设置边框
- Android TextView显示文字过长时添加阴影渐变消失效果
- Android中实现为TextView添加多个可点击的文本
- android 自定义Textview多层边框,实现了文字内容闪烁的功能!