[英]Button creation in android curved sides
In your xml add background for your button. 在xml中为按钮添加背景。
<Button
android:id="@+id/login_loginbt"
android:layout_width="fill_parent"
android:text="Login"
android:textColor="#ffffff"
android:background="@drawable/curve_button"
android:textSize="18dp"
android:textStyle="bold" />
Then create a new xml "curve_button.xml"and paste this code for curve edged buttons. 然后创建一个新的xml“ curve_button.xml”,并将此代码粘贴到曲线边缘按钮上。
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item >
<shape android:shape="rectangle" >
<corners android:radius="25dip" />
<stroke android:width="1dip" android:color="#ff0000" />
<gradient android:angle="-90" android:startColor="#ff0000" android:endColor="#ff0000" />
</shape>
</item>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.