Issue
I have created a round corner drawable resource round_corner_bg.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF"/>
<stroke android:width="3dp" android:color="#B1BCBE" />
<corners android:radius="10dp"/>
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>
I applied it to my LinearLayout
:
<LinearLayout ...>
android:background="@drawable/round_corner_bg"
...
It works fine. However, it rounded all four corners, how can I make it to only round the top left and top right corner?
Solution
Try this
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF" />
<stroke
android:width="3dp"
android:color="#B1BCBE" />
<corners android:topLeftRadius="10dp" android:topRightRadius="10dp"
android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp"/>
<padding
android:bottom="0dp"
android:left="0dp"
android:right="0dp"
android:top="0dp" />
</shape>
OUTPUT
Answered By - Goku
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.