Android帧布局-实现渐变效果
2013-12-30 20:49
288 查看
main.xml
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
android:id="@+id/view01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="210px"
android:height="50px"
android:background="#ff0000"/>
android:id="@+id/view02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="180px"
android:height="50px"
android:background="#dd0000"/>
android:id="@+id/view03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="150px"
android:height="50px"
android:background="#bb0000"/>
android:id="@+id/view04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="120px"
android:height="50px"
android:background="#990000"/>
android:id="@+id/view05"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="90px"
android:height="50px"
android:background="#770000"/>
android:id="@+id/view06"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="60px"
android:height="50px"
android:background="#550000"/>
android:id="@+id/view07"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="30px"
android:height="50px"
android:background="#330000"/>
这7个TextView的高度完全相同,而宽度逐渐减少-这样可以保证最先添加的TextView不完全遮挡,而且我们设置了7个TextView背景色渐变。
相关文章推荐
- Android帧布局介绍
- Android表格布局
- Android线性布局
- Android开发自定义View
- Android系统的常用权限
- Android中EditText属性
- Android中dip、dp、sp、pt和px的区…
- Android应用开发——系统自带样式And…
- This Android SDK …
- Android开发拖拉图片Gallery画廊组…
- android:scaleType的使用
- android中的 gravity 和…
- Android开发拖拉图片Gallery画廊组…
- Android获取当前时间
- Android开发之文本切换组件TextSwi…
- Android开发之ImageSwitcher组件的…
- Android开发之Toast组件
- Android开发之自定义评分组件
- @+id以及@id和android:id的区别
- Android当中layer-list使用