android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:text="text1" 
android:textSize="28sp" 
android:textStyle="bold" 
android:textColor="#FFFFFF" 
android:shadowColor="#ff000000"
android:shadowDx="2"
android:shadowDy="2"     
android:shadowRadius="1"/>


android:shadowColor 阴影颜色

android:shadowDx 阴影的水平偏移量

android:shadowDy 阴影的垂直偏移量

android:shadowRadius 阴影的范围

 

大多数情况下,某一类的TextView控件需要统一的风格,如加阴影等,那么可以使用style。

 

                    android:id="@+id/txBarTitle1" 
            android:text="资讯行情" />

 

然后在values文件夹下创建styles.xml文件,内容为:

 

<?xml version="1.0" encoding="utf-8"?>

   

 

这样的最大优点是减低代码冗余度,在需要更改某一类控件的样式时,不用一个一个的改过来,只需要更改styles文件中即可。

更多相关文章

  1. android不是内部或外部命令,也不是可运行的程序或批处理文件
  2. Android下拉框控件Spinner的使用
  3. android之控件EditText学习
  4. android sdk 文件目录含义介绍
  5. 如何查看android数据文件?
  6. Android 线性布局(LinearLayout)内各控件如何设置间距
  7. android刮奖控件,使用简单。
  8. android 5.0系统 EditText控件
  9. android layout以及一些常用的android控件属性

随机推荐

  1. android发现之旅之ViewRootImpl,Activity
  2. 谷歌推出新操作系统Andromeda,那Android真
  3. Android(安卓)Location服务之Geocoder
  4. Android USB状态监控(解决scheme="file")
  5. Android高手进阶教程(五)之----Android(
  6. Android夜间模式实现,通过在window上加一
  7. launcher修改--获取屏幕缩略(预览)图
  8. 加速Android(安卓)Studio/Gradle构建
  9. Android中的style&themes
  10. Android高斯模糊、高斯平滑(Gaussian Blur