Skip to content Skip to sidebar Skip to footer

How To Set Cross In Each Control Corner And Set Margin And Padding In Android

Solution 1:

Try out below code:

<?xml version="1.0" encoding="utf-8"?><RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:background="@drawable/bg03" ><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_alignParentBottom="true"android:layout_margin="10dp"android:background="@android:color/transparent"android:orientation="vertical" ><!-- <LinearLayout --><!-- android:id="@+id/layout1" --><!-- android:layout_width="wrap_content" --><!-- android:layout_height="wrap_content" --><!-- android:orientation="horizontal" > --><!-- <TextView --><!-- android:id="@+id/textView1" --><!-- android:layout_width="139dp" --><!-- android:layout_height="match_parent" --><!-- android:text="Country" --><!-- android:textColor="#a9a9a9" --><!-- android:textSize="50px" /> --><Spinnerandroid:id="@+id/spinner1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:entries="@array/colors"android:background="@drawable/round_bg" //Setthedropdownimageasbackgroundandroid:spinnerMode="dropdown" /><!-- </LinearLayout> --><LinearLayoutandroid:id="@+id/layout1"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="10dp"android:background="@drawable/selctor"android:orientation="horizontal"android:weightSum="1" ><EditTextandroid:id="@+id/editText1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginRight="5dp"android:layout_weight=".80"android:background="@drawable/round_bg"android:ems="10"android:inputType="number"android:text="Code"android:textColor="#a9a9a9" ></EditText><EditTextandroid:id="@+id/editText2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_weight=".20"android:background="@drawable/round_bg"android:ems="10"android:inputType="phone"android:text="Phone"android:textColor="#a9a9a9" /></LinearLayout><Buttonandroid:id="@+id/button1"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="10dp"android:background="@android:color/white"android:text="Next"android:textColor="#0066FF"android:textStyle="bold" /></LinearLayout></RelativeLayout>

round_bg.xml

<shapexmlns:android="http://schemas.android.com/apk/res/android"android:shape="rectangle"android:padding="40dp"><solidandroid:color="#EBEBEB"/><cornersandroid:bottomRightRadius="5dp"android:bottomLeftRadius="5dp"android:topLeftRadius="5dp"android:topRightRadius="5dp"/><paddingandroid:left="10dp"android:top="10dp"android:right="10dp"android:bottom="10dp"/></shape>

I hope this will help you.

Let me know still any issues.

Thanks.

Post a Comment for "How To Set Cross In Each Control Corner And Set Margin And Padding In Android"