android 设置textview边框以及点击效果
2016-01-29 14:13
525 查看
android 设置textview边框以及点击效果
<TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/normal_bg" android:gravity="center" android:text="中国" android:textColor="@drawable/text_color" />
normal_bg.xml
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="@color/me_center_bg" /> <corners android:radius="2dp" /> <stroke android:color="@color/c8c8c" android:width="1dp"/> <!--<padding--> <!--android:bottom="4dp"--> <!--android:left="10dp"--> <!--android:right="10dp"--> <!--android:top="4dp" />--> </shape>
text_color.xml
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="#b0b0b0" android:state_checked="true"/> <item android:color="#1e1e1e"/> </selector>
此外还有很多状态可以选择
相关文章推荐
- Material Design风格浅析
- Android 多进程编程 15问15答!
- android 学习 碎片总结
- Android签名机制之---签名过程详解
- Android签名机制之---签名验证过程详解
- Android悬浮按钮的两种实现方法(Floating action button)
- AndroidStudio 设置自动导包
- Listview indexOutOfBoundsException: Invalid index 1, size is 1
- Android NDK生成so文件
- Android手机实时视频监控
- android Universal-Image-Loader oom:关于bitmap的优化及其他优化
- Android实现入门界面布局
- Android Activity活动生命周期
- Android string.xml error: Apostrophe not preceded by \
- Android, ListView IllegalStateException: “The content of the adapter has changed but ListView did no
- 拥抱 Android Studio 之四:Maven 仓库使用与私有仓库搭建
- 在MPAndroidChart库K线图的基础上画均线
- 在MPAndroidChart库K线图的基础上画均线
- Android Studio打包生成APK
- Android从服务器下载文件