如何在android中设置每个控制角的十字,以及设置边距和填充

如何在android中设置每个控制角的十字,以及设置边距和填充,android,Android,当前结果和期望结果 尝试以下代码: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg03" > <LinearLayout

当前结果期望结果

尝试以下代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bg03" >

    <LinearLayout
        android: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="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="10dp"
            android:background="@drawable/gradient_bg_hover"
            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" />

            <Spinner
                android:id="@+id/spinner1"
                android:layout_width="wrap_content"
                android:layout_height="49dp" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/layout1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:background="@drawable/gradient_bg_hover"
            android:orientation="horizontal" >

            <TextView
                android:id="@+id/editText1"
                android:layout_width="94dp"
                android:layout_height="wrap_content"
                android:ems="10"
                android:inputType="number"
                android:text="Code"
                android:textColor="#a9a9a9" >

                <requestFocus />
            </TextView>

            <EditText
                android:id="@+id/editText2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ems="10"
                android:inputType="phone"
                android:text="Phone"
                android:textColor="#a9a9a9" />
        </LinearLayout>

        <Button
            android:id="@+id/button1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:background="@drawable/buttonshape"
            android:text="Next"
            android:textColor="#0066FF"
            android:textStyle="bold" />
    </LinearLayout>

</RelativeLayout>

round_bg.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bg03" >

    <LinearLayout
        android: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" /> -->

        <Spinner
            android:id="@+id/spinner1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:entries="@array/colors"
            android:background="@drawable/round_bg" //Set the dropdown image as background
            android:spinnerMode="dropdown" />

        <!-- </LinearLayout> -->

        <LinearLayout
            android: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" >

            <EditText
                android: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>

            <EditText
                android: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>

        <Button
            android: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>

我希望这对你有帮助

还有什么问题请告诉我


谢谢

你说的是哪个交叉按钮?交叉文本视图和微调器我的意思是说,在屏幕2中,我需要创建plz帮助…并且看到文本框的背景颜色是白色,我需要创建与plz帮助相同的颜色,我有一个下一个按钮图像..你在
渐变\u bg\u悬停
选择器中设置了哪种颜色?但我有两个查询我将如何设置屏幕2中文本字段中写入的CountryName,然后设置android:entries=“@array/colors”?哪个color@GrlsHu告诉android:background=“@drawable/selctor”那怎么办this@GrlsHu早上好,你在吗?@user3587940
android:entries=“@array/colors”
这是我在spinner中为绑定保留的值列表。可以在微调器中设置自己的值。我为我的理解而设置的选择器可以根据需要创建布局。你可以创建或设置自己的设计根据你。我需要显示国家名称,我的意思是你可以看到国家名称有我想显示在textview plz帮助
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="40dp">
 <solid android:color="#EBEBEB"/>
    <corners
     android:bottomRightRadius="5dp"
     android:bottomLeftRadius="5dp"
  android:topLeftRadius="5dp"
  android:topRightRadius="5dp"/>
    <padding android:left="10dp"
        android:top="10dp"
        android:right="10dp"
        android:bottom="10dp"/>
</shape>