我得到的Android應用程序謨以下警告在Eclipse上:的Android/Eclipse的:這個的LinearLayout佈局或其RelativeLayout的父母可能是無用
This LinearLayout layout or its RelativeLayout parent is possibly useless
想不通的問題是什麼。閱讀其他論壇,但他們沒有幫助。有任何想法嗎?
下面的代碼:
<?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:gravity="top" >
<LinearLayout
android:id="@+id/lin_progress_bar"
android:layout_width="200dp"
android:layout_height="65dp"
android:layout_marginLeft="60dp"
android:layout_marginTop="150dp"
android:visibility="invisible" >
<ProgressBar
android:id="@+id/ProgressBar01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</ProgressBar>
<TextView
android:id="@+id/TextView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="30dp"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:text="@string/loading"
android:textColor="#808080"
android:textSize="17sp"
android:textStyle="bold" >
</TextView>
</LinearLayout>
</RelativeLayout>
這真是沒用茨艾倫有兩個嵌套的容器。我會刪除LinearLayout(我總是喜歡RelativeLayouts)。 –
請勿使用硬編碼的'layout_width's和'layout_height's。你的應用程序將運行在各種設備上,如果你使用硬編碼值,你可能不會總是得到相同的外觀。儘量使用標準的'match_parent'和'wrap_content'和layout_weights。 –