아래 컨트롤 레이아웃의 경우 선형 레이아웃이 2 개인 상대 레이아웃을 사용하고 있습니다. 1 회색 배경의 B1, B2 및 B3에 대한 선형 레이아웃과 B4, B5 및 B6의 선형 레이아웃 1 개.Android : Relativelayout 행의 배경
상대적 레이아웃 내의 선형 레이아웃을 사용하면 렌더링 속도가 느려집니다.
어떻게 선형 레이아웃을 없앨 수 있습니까? 특히 B1, B2, B3 행에 대한 회색 배경을 얻을 수 없습니다. 아니면 이런 식으로 괜찮다고 생각하니? 모든 도움을 미리 감사드립니다.
편집 :
아래는 그냥 건물과 가능하면 하위 레이아웃을 제거하는 노력을 시작 내 XML이다. 당신의 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" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:src="@drawable/ic_launcher" />
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@drawable/abc_ic_search_api_holo_light" />
<TextView
android:id="@+id/textView1"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_below="@+id/imageButton1"
android:layout_centerHorizontal="true"
android:text=" Test Label" />
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/textView1"
android:layout_marginTop="54dp"
android:background="@android:color/darker_gray" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_toRightOf="@+id/linearLayout1"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/button1"
android:layout_alignBottom="@+id/button1"
android:layout_marginLeft="18dp"
android:layout_toRightOf="@+id/imageView1"
android:text="Button" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/button2"
android:layout_alignBottom="@+id/button2"
android:layout_toRightOf="@+id/button2"
android:text="Button" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/linearLayout1"
android:layout_marginTop="31dp" >
<Button
android:id="@+id/button6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/button5"
android:layout_toLeftOf="@+id/imageButton1"
android:text="Button" />
<Button
android:id="@+id/button4"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/linearLayout2"
android:layout_centerVertical="true"
android:text="Button" />
<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/button4"
android:text="Button" />
</LinearLayout>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/textView1"
android:layout_alignTop="@+id/listView1"
android:layout_marginRight="15dp"
android:text="TextView" />
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/linearLayout2"
android:layout_marginTop="18dp" >
</ListView>
</RelativeLayout>
에는 XML 파일이 포함되어 있습니다. – Booger