textview加边框 收藏
方法一:


比较土 ,加背景图片,透明的带边框的背景图片

设置到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>


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/zhanghw0917/archive/2010/06/01/5639065.aspx

更多相关文章

  1. 浅谈Java中Collections.sort对List排序的两种方法
  2. Python list sort方法的具体使用
  3. python list.sort()根据多个关键字排序的方法实现
  4. android上一些方法的区别和用法的注意事项
  5. android实现字体闪烁动画的方法
  6. android去除ImageButton白色边框
  7. Android中dispatchDraw分析
  8. Android四大基本组件介绍与生命周期
  9. Android(安卓)MediaPlayer 常用方法介绍

随机推荐

  1. 怎么解决这个问题“The connection to ad
  2. Android(安卓)Audio 分析
  3. 8.3facebook分享后不回调结果原因,java标
  4. ANDROID_SDK_HOME的设置
  5. 深入了解Android图形管道-part1
  6. android 系统启动过程中加入tcpdump和log
  7. Android(安卓)Studio 断点调试和高级调试
  8. android仿人人网右边可推出的效果
  9. Android(安卓)2.3 NDK的新特性
  10. activity-alias的使用