android中 layer-list跟include的使用
android中 layer-list和include的使用layer-list 看来是图层的累加 我是这么理解的,字面上是多个层,也就是
android中 layer-list和include的使用
layer-list 看来是图层的累加 我是这么理解的,字面上是多个层,也就是呢你可以把多个leyaer放在一起然后一其显现出来 如qqw.xml
view plaincopy to clipboardprint?
- <?xml?version="1.0"?encoding="utf-8"?>??
- <layer-list?xmlns:android="http://schemas.android.com/apk/res/android">??
- ???<item>??
- ??????<shape>??
- ?????????<solid?android:color="#FF00ff00"?/>??
- ?????????<gradient????
- ??????????????????android:useLevel="true"????
- ?????????????????android:type="sweep"????
- ??????????????????android:startColor="#ff000000"????
- ??????????????????android:endColor="#ffff0000"?/>???
- ??????</shape>??
- ???</item>??
- ????<item>????
- ????????<rotate????
- ???????????android:pivotX="50%"?android:pivotY="50%"????
- ????????????android:fromDegrees="0"?android:toDegrees="80"????
- ???????????android:drawable="@drawable/icon"?/>????
- ????</item>????
- ????
- </layer-list>??
?
?
然后就可以在别处引用了
view plaincopy to clipboardprint?
- <ImageButton?android:id="@+id/btnFindMe"????
- ????????android:layout_width="wrap_content"????
- ????????android:layout_height="wrap_content"???
- ???????android:layout_centerInParent="true"??
- ????????android:background="@drawable/qqw"/>??
?
例如在 android:style/Widget.ProgressBar.Large 或者其他的progressbar风格
view plaincopy to clipboardprint?
- <mce:style?name="progressBarStyleSmall"?parent="android:style/Widget.ProgressBar.Large"><!--?
- <item?name="android:indeterminateDrawable">@drawable/progress</item>?
- --></mce:style><style?name="progressBarStyleSmall"?parent="android:style/Widget.ProgressBar.Large"?mce_bogus="1"><item?name="android:indeterminateDrawable">@drawable/progress</item></style>??
- <layer-list?xmlns:android="http://schemas.android.com/apk/res/android">??
- ???<!--???<item?android:drawable="@android:drawable/progress_circular_background"?/>-->??
- ?????<!--??<item>??
- ??????
- ????
- ????????<shape?android:shape="ring"??
- ???????????????android:innerRadiusRatio="3.4"??
- ???????????????android:thicknessRatio="6.0">??
- ????????????<gradient??
- ???????????????????android:useLevel="true"??
- ???????????????????android:type="sweep"??
- ???????????????????android:startColor="#ff000000"??
- ???????????????????android:endColor="#ffffffff"?/>??
- ????????</shape>??
- ??????????
- ????????????
- ????</item>?-->??
- ????<item>??
- ????????<rotate??
- ????????????android:pivotX="50%"?android:pivotY="50%"??
- padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; border-top-style: none; border-right-style: none; border-bottom-style: no