首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android shape渐近线成效

2012-09-03 
android shape渐近线效果?android:layout_widthfill_parent android:layout_heightwrap_content ??

android shape渐近线效果
?android:layout_width="fill_parent"
android:layout_height="wrap_content">

??? <LinearLayout
??? android:orientation="vertical"
??????? android:layout_width="fill_parent"
??????? android:layout_height="wrap_content">
???
<ImageView
android:layout_width="fill_parent"
android:layout_height="50dip"
android:src="@drawable/shape_1" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="50dip"
android:src="@drawable/line" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="50dip"
android:src="@drawable/shape_2" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/line" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="50dip"
android:src="@drawable/shape_3" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="20dip"
android:src="@drawable/line" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="50dip"
android:src="@drawable/shape_4" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/line" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="50dip"

android:src="@drawable/shape_5" />

</LinearLayout>
</ScrollView>
shape_5的代码:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
??? <gradient android:startColor="#FFFF0000" android:endColor="#80FF00FF"
??????????? android:angle="270"/>
??? <padding android:left="50dp" android:top="20dp"
??????????? android:right="7dp" android:bottom="7dp" />
??? <corners android:radius="8dp" />
???
</shape>
gradient? 产生颜色渐变? android:angle 从哪个角度开始变 貌似只有90的整数倍可以
android:shape="rectangle" 默认的也是长方形

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
??? <solid android:color="#ff4100ff"/>
??? <stroke android:width="2dp" android:color="#ee31ff5e"
??????????? android:dashWidth="3dp" android:dashGap="2dp" />
??? <padding android:left="7dp" android:top="7dp"
??????????? android:right="7dp" android:bottom="7dp" />
??? <corners android:radius="6dp" />
</shape>

#ff4100ff蓝色#ff4100ff绿色
???? <solid android:color="#ff4100ff"/>实心的 填充里面
???? <stroke 描边 采用那样的方式将外形轮廓线画出来

android:dashWidth="3dp" android:dashGap="2dp" 默认值为0

android:width="2dp" android:color="#FF00ff00"笔的粗细,
?????? android:dashWidth="5dp" android:dashGap="5dp" 实现- - -这样的效果,dashWidth指的是一条小横线的宽度
?????? dashGap 指的是 小横线与小横线的间距。 width="2dp" 不能太宽

热点排行