2012-12-05 3 views
0

아래 코드와 같이 둥근 모서리가있는 두 개의 직선형 레이아웃이 있습니다.Android 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="[email protected]" > 

        <!-- <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> 

도움을 주시면 감사하겠습니다.

답변

1

나는 당신이 정말로 원하는 것을 분명히 이해하지 못합니다. 언제든지
this과 같은 것을 찾고 계신가요?

편집 : 여기

은 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="[email protected]" > 

        <!-- <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> 

+0

그게 정확히 무엇을 찾고 임 ... 가능하면,이 코드를보고 좋은 것? – user1859465

+0

물론 문제는 없지만 대답을 편집했습니다. –

관련 문제