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

Android button设置height后圆角消失有关问题

2012-06-28 
Android button设置height后圆角消失问题?xml version1.0 encodingutf-8?selectorxmlns:android

Android button设置height后圆角消失问题

<?xml version="1.0" encoding="utf-8"?><selector    xmlns:android="http://schemas.android.com/apk/res/android">    <!-- pressed -->    <item android:state_pressed="true" >        <shape  android:shape="rectangle">            <gradient                android:startColor="#ff8c00"                android:endColor="#ff8c00"                android:angle="270" />                       <corners                android:radius="4dp" />        </shape>    </item>   <!-- focus -->   <item android:state_focused="true" >        <shape>            <gradient                android:startColor="#ffc2b7"                android:endColor="#ffc2b7"                android:angle="270" />                        <corners                android:radius="4dp" />        </shape>    </item>        </selector>然后在button的定义中加上:android:background="@drawable/button_selector_gradient"(button_selector_gradient是上述xml文件的文件名称)

热点排行