0

以下のコードに示すように、角が丸い2つの線形レイアウトがあります。

私が達成しようとしているのは、linearlayout内のlinearlayoutですが、上部の外側のレイアウトマージンがギャップを強制して、テキストを入力できるようにします。内部は、内側のレイアウトに暗い境界線があるように見えます。

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

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="62dp"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_margin="5dip"
            android:background="@drawable/rounded_rectangle_dark"
            android:orientation="vertical"
             >

           <!--  TextView goes here -->

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="10dip"
            android:background="@drawable/rounded_rectangle_white"
            android:orientation="vertical" >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content" >

                <ImageView
                    android:id="@+id/imageView2"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_gravity="center"
                    android:scaleType="fitCenter"
                    android:src="@drawable/icon_contact" />

                <EditText
                    android:id="@+id/login_username_edittext"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="15dp"
                    android:layout_weight="1"
                    android:hint="@string/login_username_hint"
                    android:inputType="textEmailAddress"
                    android:text="pandulce@email.com" >

                    <!--  <requestFocus />-->
                </EditText>
            </LinearLayout>
        </LinearLayout>
        </LinearLayout>

        <!-- End of Inner Layout -->

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="40dp"
            android:layout_marginRight="40dp"
            android:layout_marginTop="10dp"
            android:orientation="vertical" >

            <Button
                android:id="@+id/login_btn"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/red_button"
                android:textStyle="bold"
                android:textSize="25sp"
                android:text="@string/login_login_btn"
                android:textColor="@color/solid_white" />
        </LinearLayout>
    </LinearLayout>

</RelativeLayout>

これがカラースタイルです。

    <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> 
    <solid android:color="#ffffff"/>    
    <stroke android:width="1dp"
            android:color="#2B3856"/>
    <corners android:radius="20dp"/> 

</shape>

どんな助けでも大歓迎です。

4

1 に答える 1

1

あなたが本当に何を望んでいるのか、はっきりとはわかりません。
ひょっとしてこんなものをお探しですか?

編集:

XML レイアウトは次のとおりです。

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

<LinearLayout
    android:id="@+id/linearLayout1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_marginBottom="62dp"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_margin="5dip"
        android:background="@drawable/rounded_rectangle_dark"
        android:orientation="vertical" >

        <!-- TextView goes here -->



        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:layout_marginTop="5dp"
            android:text="TextView"
            android:textColor="#FFFFFF" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="5dip"
            android:background="@drawable/rounded_rectangle_white"
            android:orientation="vertical" >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content" >

                <ImageView
                    android:id="@+id/imageView2"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_gravity="center"
                    android:scaleType="fitCenter" />

                <EditText
                    android:id="@+id/login_username_edittext"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="15dp"
                    android:layout_weight="1"
                    android:inputType="textEmailAddress"
                    android:text="pandulce@email.com" >

                    <!-- <requestFocus /> -->
                </EditText>
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>

    <!-- End of Inner Layout -->

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="40dp"
        android:layout_marginRight="40dp"
        android:layout_marginTop="10dp"
        android:orientation="vertical" >

        <Button
            android:id="@+id/login_btn"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/red_button"
            android:textSize="25sp"
            android:textStyle="bold"
            android:text="Log in"
            android:textColor="#FFFFFF" />
    </LinearLayout>
</LinearLayout>

于 2012-12-05T15:59:46.210 に答える