android:elevation属性,控制View底部渐变阴影
2018-02-26 14:51
871 查看
android:elevation属性,控制View底部渐变阴影
android:elevation这一属性,可以控制View底部渐变阴影,给一个View在其底部增加一定的灰度渐变阴影效果,如图:
![](https://oscdn.geek-share.com/Uploads/Images/Content/202009/24/47189ae0ba6eff2f902cb64b932644ca)
上图是一个简单的TextView,TextView底部阴影渐变。
实现代码通过配置elevation实现:
android:elevation这一属性,可以控制View底部渐变阴影,给一个View在其底部增加一定的灰度渐变阴影效果,如图:
上图是一个简单的TextView,TextView底部阴影渐变。
实现代码通过配置elevation实现:
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="50dp" android:background="@android:color/background_light" android:elevation="10dp" android:text="底部的阴影" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="50dp" android:text="1" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="50dp" android:text="2" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="50dp" android:text="3" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="50dp" android:text="4" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="50dp" android:text="5" /> </LinearLayout>
相关文章推荐
- 在不使用 android:elevation 属性的情况下设置View阴影
- Android 基础:Materia Design 定义视图阴影elevation和创建卡片CardView
- Android 控制HorizontalScrollView 动态添加View后 控制滚动到最后(最右边)或底部
- Android中recyclerView底部添加透明渐变效果
- android 在bitmap或者view上 添加渐变阴影
- 使用代码控制Android的TextView属性drawableLeft
- android listview/ScrollView 去除顶部下拉时的半月形阴影和上下滑动顶部和底部的虚化
- Android 自定义view及其属性。友情链接底部有动画链接
- Android 用属性动画自定义view的渐变背景
- Android解析自定义属性的XML实现底部导航栏TabSelectedView,实现灵活的配置扩展
- Android的TextView属性XML详解与android文字阴影效果
- Android TextView显示文字过长时添加阴影渐变消失效果
- android listview/ScrollView 去除顶部下拉时的半月形阴影和上下滑动顶部和底部的虚化
- Android原生桌面顶部和底部的渐变阴影去除方法
- android去掉滑动到顶部和底部的阴影
- Android LRecyclerView实现下拉刷新,滑动到底部自动加载更多
- android中如何在代码中直接设置View的layout_weight属性
- Android之RadioGroup+ViewPager制作的底部导航栏
- Android_TextView属性XML详解
- Android-ImageView的属性android:scaleType作用