android xml绘图p113-p117
生活随笔
收集整理的這篇文章主要介紹了
android xml绘图p113-p117
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.Bitmap
<?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android"android:src="@mipmap/ic_launcher"></bitmap>2.shape
?
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="rectangle"><!--shape有rectangle(矩形)、oval(橢圓)、line(直線)、ring(環)--><!--corners在shape為rectangle的時候使用,默認為1dp--><cornersandroid:bottomLeftRadius="1dp"android:bottomRightRadius="1dp"android:radius="1dp"android:topLeftRadius="1dp"android:topRightRadius="1dp" /><!--gradient漸變--><gradientandroid:angle="integer"android:centerColor="color"android:centerX="integer"android:centerY="integer"android:endColor="color"android:gradientRadius="integer"android:startColor="color"android:type="linear/radial/sweep"android:useLevel="boolean" /><paddingandroid:bottom="1dp"android:left="1dp"android:right="1dp"android:top="1dp" /><!--size指定大小,一般用在imageView配合scaleType屬性使用--><size android:width="integer"android:height="integer"/><!--solid填充顏色--><solid android:color="color"/><!--stroke指定邊框 dashWidth:虛線寬度 dashGap:虛線間隔寬度 --><stroke android:color="color"android:width="integer"android:dashWidth="integer"android:dashGap="integer"/></shape>?
?
3.layer ?圖層疊加
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"><item android:drawable="@mipmap/ic_launcher" /><itemandroid:bottom="10dp"android:drawable="@mipmap/ic_launcher"android:left="10dp"android:right="10dp"android:top="10dp" /></layer-list>?
4.Selector
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"><!--默認時的背景圖片--><item android:drawable="@mipmap/ic_launcher" /><!--沒有焦點時的背景圖片--><item android:drawable="@mipmap/ic_launcher" android:state_window_focused="false" /><!--非觸摸模式下點擊時的背景圖片--><item android:drawable="@mipmap/ic_launcher" android:state_focused="true" android:state_pressed="true" /><!--觸摸模式下單擊時的背景圖片--><item android:drawable="@mipmap/ic_launcher" android:state_focused="false" android:state_pressed="true" /><!--選中時的背景圖片--><item android:drawable="@mipmap/ic_launcher" android:state_selected="true" /><!--獲取焦點時的背景圖片-->< item android:drawable="@mipmap/ic_launcher" android:state_focused="true" /> </selector>通常情況下都是可以組合使用的
?
轉載于:https://www.cnblogs.com/zzw1994/p/5662977.html
總結
以上是生活随笔為你收集整理的android xml绘图p113-p117的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: UE中渲染自发光通道的折衷方案
- 下一篇: 老外谈社交媒体:2015社交平台最新运营