我有2個LinearLayouts和一個相對佈局中的按鈕。 他們應該是這樣的:如何設置具有頂部,中間和底部元素的佈局?
一個的LinearLayout與頂欄(約畫面的20%。)
大量的滾動視圖,其佔據了大部分屏幕(約元素的60。屏幕%)
在
我試圖此底部(約屏幕的20%)甲按鈕:
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/layoutTopBlack"
android:layout_alignParentTop="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<include layout="@layout/top_black_bar_cancel_register_button"/>
</LinearLayout>
<LinearLayout
android:id="@+id/layoutCenter"
android:layout_below="@id/layoutTopBlack"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<include layout="@layout/top_black_bar_cancel_register_button"/>
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:id="@+id/buttonNextStep"
android:text="@string/next_step"
style="@style/mainButtonStyle"/>
</RelativeLayout>
這不起作用。 layoutCenter放在按鈕上,所以我從來沒有看到按鈕。
有什麼建議嗎?
在此先感謝。
編輯: 我發現這個從編輯: 無法解析資源@ ID/layoutTopBlack
嗯,我得到無法解決資源@ id/layoutTopBlack,即使我已經添加了@ + ID/ – Ikky
@Ikky你是如何解決你的問題與無法解決資源?我通常只是使用@ + id /移動資源,直到它工作。 –