Issue
I want to make a layout corners with shape like in this images .i goggled in net but i didn't found any code regarding curve shape, please help me ,please check the below image. i want to design linear layout with curve shape.
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/curve"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dp"
android:text="Hi, This layout has rounded corner borders ..." />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<!-- view background color -->
<solid
android:color="#a9c5ac" >
</solid>
<!-- view border color and width -->
<stroke
android:width="1dp"
android:color="#1c1b20" >
</stroke>
<!-- If you want to add some padding -->
<padding
android:left="4dp"
android:top="4dp"
android:right="4dp"
android:bottom="4dp" >
</padding>
<!-- Here is the corner radius -->
<corners
android:radius="8dp"
android:bottomLeftRadius="-15dp"
android:bottomRightRadius="-15dp"
android:topLeftRadius="-15dp"
android:topRightRadius="-15dp" >
</corners>
</shape>
Solution
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/curve"
android:gravity="center_vertical|center_horizontal"
android:padding="5dp"
android:text="Hi, This layout has rounded corner borders ..." />
use this curve.9.png image
Answered By - Darshil Shah
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.