Android--为TextView添加边框
2012-11-26 15:05
316 查看
方法一:
比较土 ,加背景图片,透明的带边框的背景图片
设置到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添加边框
- android 为TextView添加边框
- android 为TextView添加边框
- android里TextView加下划线的几种方式 以及 为TextView添加边框 4000
- android 为TextView添加边框
- android 圆角边框、渐变背景的TextView
- Android中TextView添加删除线
- Android TextView 高亮字体并添加点击事件
- Android中TextView内容过长 添加滚动条进行展示
- Android使用SharedPreferences实现本地轻量存储,ToggleButton,TextView边框详解
- Android--去除EditText边框,添加下划线
- Android中EditText如何去除边框添加下划线
- Android Textview 添加下划线 方法
- Android TextView不带边框问题
- android:为TextView添加样式——下划线,颜色,设置链接样式及前背景色