-2
Create a Drawable
to make the shape of the corner
, with the name corner.xml
, as below:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<stroke
android:width="2dp"
android:color="#FF0000">
</stroke>
<solid
android:color="#FFFF00">
</solid>
<corners
android:topLeftRadius="5dp"
android:topRightRadius="0dp"
android:bottomLeftRadius="5dp"
android:bottomRightRadius="0dp">
</corners>
</shape>
After that enter the same as your background LinearLayout
, as below:
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="200dp"
android:layout_height="100dp"
android:gravity="center"
android:layout_centerInParent="true"
android:background="@drawable/corner">
</LinearLayout>
Okay, but what’s the problem? Any questions? Are you having trouble reproducing in the code what’s in the images? Welcome to SO-PT, don’t forget to do the [tour] and see also How to create an example and How to ask a good question
– Barbetta