欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android使用xml自定義圖片實(shí)例詳解

 更新時間:2017年05月25日 16:11:37   作者:將進(jìn)酒-杯莫停  
這篇文章主要介紹了 Android使用xml自定義圖片實(shí)例詳解的相關(guān)資料,需要的朋友可以參考下

Android使用xml自定義圖片實(shí)例詳解

實(shí)現(xiàn)效果圖:

白色圓角圖片

bg_round_rectangle_white.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="rectangle">

 <!-- 填充 -->
 <solid android:color="#FFFFFF" />

 <!-- 圓角 -->
 <corners
  android:radius="2dp"/>

 <!-- 描邊 -->
 <stroke
  android:width="1dp"
  android:color="#D5D5D5"/>

</shape>

白色圓角虛線框

bg_round_rectangle_white_dash.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="rectangle">

 <!-- 填充 -->
 <solid android:color="#FFFFFF" />

 <!-- 圓角 -->
 <corners
  android:radius="2dp"/>

 <!-- 虛線描邊 -->
 <stroke
  android:width="1dp"
  android:color="#DD4041"
  android:dashWidth="1dp"
  android:dashGap="2dp"/>

</shape>

紅色圓角圖片

bg_round_rectangle_red.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="rectangle">

 <!-- 填充 -->
 <solid android:color="#F15C5D" />

 <!-- 圓角 -->
 <corners
  android:radius="2dp"/>

 <!-- 描邊 -->
 <stroke
  android:width="1dp"
  android:color="#D42D2E"/>

</shape>

綠色圓角圖片

bg_round_rectangle_green.xml


<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="rectangle">

 <!-- 填充 -->
 <solid android:color="#88C14E" />

 <!-- 圓角 -->
 <corners
  android:radius="2dp"/>

 <!-- 描邊 -->
 <stroke
  android:width="1dp"
  android:color="#6FA13C"/>

</shape>

正三角形圖片

triangle_white_arrow_up.xml


<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
 android:fromDegrees="45"
 android:toDegrees="45"
 android:pivotX="-40%"
 android:pivotY="80%">

 <shape android:shape="rectangle">
  <solid android:color="#000000"/>
 </shape>

</rotate>

倒立正三角形圖片

triangle_white_arrow_down.xml


<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
 android:fromDegrees="45"
 android:toDegrees="45"
 android:pivotX="135%"
 android:pivotY="15%">

 <shape android:shape="rectangle">
  <solid android:color="#000000"/>
 </shape>

</rotate>

感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!

相關(guān)文章

最新評論