广州到台北有多远:android:shape的使用

来源:百度文库 编辑:偶看新闻 时间:2024/04/28 20:46:48
  1. _selector"  
  2.     />  
  3. >  



  4. button_selector.xml:

XML/HTML代码
  1.   
  2.     xmlns:android="http://schemas.android.com/apk/res/android">  
  3.       
  4.           
  5.               
  6.             
  7.                 android:startColor="#ff8c00"  
  8.                 android:endColor="#FFFFFF"  
  9.                 android:type="radial"  
  10.                 android:gradientRadius="50" />  
  11.               
  12.             
  13.                 android:width="2dp"  
  14.                 android:color="#dcdcdc"  
  15.                 android:dashWidth="5dp"  
  16.                 android:dashGap="3dp" />  
  17.               
  18.             
  19.                 android:radius="2dp" />  
  20.             
  21.                 android:left="10dp"  
  22.                 android:top="10dp"  
  23.                 android:right="10dp"  
  24.                 android:bottom="10dp" />  
  25.           
  26.       
  27.       
  28.           
  29.             
  30.                 android:startColor="#ffc2b7"  
  31.                 android:endColor="#ffc2b7"  
  32.                 android:angle="270" />  
  33.             
  34.                 android:width="2dp"  
  35.                 android:color="#dcdcdc" />  
  36.             
  37.                 android:radius="2dp" />  
  38.             
  39.                 android:left="10dp"  
  40.                 android:top="10dp"  
  41.                 android:right="10dp"  
  42.                 android:bottom="10dp" />  
  43.           
  44.       
  45.             
  46.           
  47.               
  48.             
  49.                 android:width="2dp"  
  50.                 android:color="#fad3cf" />  
  51.             
  52.                 android:topRightRadius="5dp"  
  53.                 android:bottomLeftRadius="5dp"  
  54.                 android:topLeftRadius="0dp"  
  55.                 android:bottomRightRadius="0dp"  
  56.             />  
  57.             
  58.                 android:left="10dp"  
  59.                 android:top="10dp"  
  60.                 android:right="10dp"  
  61.                 android:bottom="10dp" />  
  62.           
  63.       
  64.   


运行效果如下图:
一般状态:


获得焦点状态:


按下状态: