我有線性佈局此LinearLayout佈局或其RelativeLayout父項是無用的;垂直和水平方向
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#1875b5"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".AboutUs"
tools:ignore="HardcodedText" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="25dp"
android:layout_marginTop="15dp"
android:background="#186db5"
android:orientation="horizontal" >
這裏你可以看到所有的代碼 http://www.a2b4.net/linearlayout.txt
不要有
This LinearLayout layout or its RelativeLayout parent is useless; transfer the background attribute to the other view
警告。
我如何合併,不會有警告。
一個是水平的其他垂直。
目前還不清楚你在問什麼。你是否收到一條警告信息,表示你的某個佈局是無用的?另外,請提供您的整個佈局文件,以便我們可以看到這些部件是如何相關的。 – scottt
這裏是所有的代碼http://www.a2b4.net/linearlayout.txt – lospicos
哇,這是很多佈局!爲了提高性能並避免內存問題,對RelativeLayout(s),GridView或TableLayout的left-of/right-of等屬性可能會更好。但我會檢查你現有的方法... – scottt