我创建了一个按钮并设置了背景颜色和文本颜色,如下所示。我的问题是:如何设置按钮边框颜色?我想将边框颜色设置为白色
这是我的按钮res -> layout -> main_nav.xml
<Button
android:id="@+id/btn_emergency"
style="@style/buttonStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Contact and Emergency"
android:onClick="onClickHandleStates" />
这是它的相关样式res -> values -> styles
。前 2 个“项目”可以自行正常工作。最后一个“项目”是我尝试将按钮边框更改为白色但没有成功。
<!-- The button styles -->
<style name="buttonStyle">
<item name="android:textColor">#ffffff</item>
<item name="android:background">#80000000</item>
<item name="android:button">
<shape
android:shape="rectangle" >
<stroke
android:width="0.5dp"
android:color="#ffffff" />
</shape>
</item>
</style>