我在我的項目上有幾個xml佈局。當應用程序啓動時,main.xml佈局會在設備上加載。當我加載第二個XML佈局它從主要infront,但不包括所有的屏幕,你也看到後面是主要的佈局在android中的佈局
第二個佈局是使用match_parent和XML代碼是
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" android:weightSum="1">
//something
</LinearLayout>
此艾德里安我試圖做的是第二個佈局採取所有的屏幕,而不是能夠看到背面的主。 這是可以做到的嗎?
編輯
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableLayout android:layout_width="match_parent"
android:layout_height="match_parent" >
<TableRow >
<TextView android:text="Password Recovery" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="match_parent"></TextView>
</TableRow>
<TableRow >
<TextView android:text="Username: " android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<EditText android:text=" " android:id="@+id/UsernameRecovery" android:layout_width="100dp" android:layout_height="45dp"></EditText>
</TableRow>
<TableRow >
<Button android:text="Submit" android:id="@+id/SubmitRecoveryPass" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<Button android:text="Cancel" android:id="@+id/CancelRecoveryPass" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</TableRow>
</TableLayout>
</LinearLayout>
我有什麼,以全屏幕改變並沒有能夠看到後面
你應該發佈你實際進行切換的代碼。 – dmon 2012-01-27 01:20:14
你有沒有嘗試過:android:layout_height =「wrap_content」? – 2012-01-27 05:32:15