Android开发如何设置文字阴影
16lz
2021-01-23
关键字:Android,Android开发,阴影,文字阴影
在android开发中,我们为了android界面看起来效果美观,给用户一个好的体验,就要使用各种各样的效果,本文介绍在Android开发中如何设置文字阴影
关于android文字阴影,共有四个属性可以设置:
android:shadowDx :阴影x方向位移
android:shadowDy :阴影y方向位移
android:shadowColor :阴影颜色
android:shadowRadius :阴影的半径
注意:阴影的半径必须设置(为0时没有效果)。
android:shadowColor="#ff000000" // 前两位为透明度
android:shadowDx="2"
android:shadowDy="0"
android:shadowRadius="1" // 这一项是必须要有的数字越大阴影会越透明和扩散
下面看一个TextView例子:
<TextView
2android:id="@+id/text"
3android:layout_width="wrap_content"
4android:layout_height="wrap_content"
5android:text="text1"
6android:textSize="35dip"
7android:textStyle="bold"
8android:textColor="#FFFFFF"
9android:shadowColor="#ff000000"
10android:shadowDx="2"
11android:shadowDy="2"
12android:shadowRadius="1"
13/>
更多相关文章
- android TextView 阴影效果,和使用style学习
- 登录时旋转等待效果
- [整] Android ListView 去除边缘阴影、选中色、拖动背景色等
- Android实现局部图片滑动指引效果
- Android TextView的特殊使用:阴影,加样式
- android RelativeLayout属性和使用, 实现上面view叠加在下面view
- RelativeLayout属性和使用, 实现上面view叠加在下面view之上的效
- Android之用自定义的shape去实现shadow效果
- Android动画效果