[英]How to make button like this in Android?
我正在嘗試使用以下布局在android中實現按鈕。如何制作?
我已經實現了這樣的按鈕
我用下面的代碼來制作
<TextView
android:id="@+id/action_text_share"
style="@style/mediumTextSize"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:gravity="center"
android:singleLine="false"
android:text="Share by Text"
android:padding="10dp"
android:layout_weight="1"
android:background="@drawable/white_broder_round_with_transparent_bg"
android:textColor="@color/blackColor" />
並有這樣的繪畫
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/removeContactRedColor"/>
<stroke android:width="2dip" android:color="@color/removeContactRedColor" />
<corners
android:radius="5dip"
/>
</shape>
您可以在drawable中這樣做, <item android:right="-2dp">
將從右端刪除筆划。
<item android:right="-2dp">
<shape>
<corners android:radius="4dp"/>
<solid android:color="@android:color/transparent" />
<stroke
android:width="1dp"
android:color="@color/app_white" />
</shape>
</item>
一些建議:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.