【Android-UI】TextView底部边框实现
2014-10-30 11:45
405 查看
先设置三个TextView 加以区分,中间TextView是实现底部边框的效果
<TextView
android:background="@android:color/white"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello World, MyActivity"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/item"
android:text="Hello World, MyActivity"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:text="Hello World, MyActivity"
/>
实现底部边框效果 item.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="#ffa8abad" />
</shape>
</item>
<item android:top="1dp">
<shape >
<solid android:color="#FFFFFF" />
</shape>
</item>
</layer-list>
<TextView
android:background="@android:color/white"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello World, MyActivity"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/item"
android:text="Hello World, MyActivity"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:text="Hello World, MyActivity"
/>
实现底部边框效果 item.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="#ffa8abad" />
</shape>
</item>
<item android:top="1dp">
<shape >
<solid android:color="#FFFFFF" />
</shape>
</item>
</layer-list>
相关文章推荐
- Android UI设计之<四>自定义TextView属性,实现带边框效果的TextView
- Android开发UI之textview实现高亮显示并点击跳转
- android 自定义Textview多层边框,实现了文字内容闪烁的功能!
- Android UI之TextView实现图文混合效果
- Android UI 之居中绘制文本内容的正确方法——实现自定义一个TextView
- Android常用UI编程_TextView实现跑马灯效果
- Android底部导航栏实现(三)之TextView+LinearLayout
- Android UI设计之<六>使用HTML标签,实现在TextView中对部分文字进行加粗显示
- Android UI 之居中绘制文本内容的正确方法——实现自定义一个TextView
- Android使用SharedPreferences实现本地轻量存储,ToggleButton,TextView边框详解
- Android基础UI之TextView实现跑马灯效果
- 【Android UI】自定义TextView实现动态的文字闪动效果
- android xml实现TextView圆角 边框颜色 边框长度 背景色
- Android UI 之居中绘制文本内容的正确方法——实现自定义一个TextView
- Android常用UI编程_TextView实现Activity转变
- android-实现仿系统search框的autoCompleteTextView----如何调用系统的隐藏方法
- Android实战技巧:用TextView实现Rich Text---在同一个TextView中设置不同的字体风格
- 转载 Android简单实现ImageView的加边框颜色的方法
- Android实战技巧:用TextView实现Rich Text---在同一个TextView中设置不同的字体风格
- 【郭林专刊】Android实战技巧:用TextView实现Rich Text---在同一个TextView中设置不同的字体风格