我希望创建类似于
的登录和注册按钮。
![这个](https://istack.dev59.com/AkY3y.webp)
将button.xml包含在您的布局中,并通过为其设置id或将边框设置为按钮来将其用作按钮,以便获得相同的结果。
button.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/border">
<TextView android:id="@+id/skillTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cleaner"
android:textSize="@dimen/abc_text_size_medium_material"
android:textColor="@color/text_grey"
android:layout_margin="@dimen/normal_margin"
android:layout_centerInParent="true"
/>
</RelativeLayout>
drawable/border.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="5dp"
/>
<stroke
android:width="1dp"
android:color="@color/white" />
</shape>