Reputation: 173
I am trying to implement button in android with following layout.How to make it??
i have already implemented button like this
i used following code to make
<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" />
and have drawable like this
<?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>
Upvotes: 0
Views: 192
Reputation: 12953
Design a Background Image and Set it to Button with correct Padding and Margin
Set Text with The Background of Similar Above Image according to your Need
Upvotes: 0
Reputation: 2080
You can do like this in drawable, <item android:right="-2dp">
will remove stroke from the right end.
<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>
Upvotes: 1
Reputation: 19288
Some suggestions:
Upvotes: 0