我有這個佈局的問題,我找不到什麼是錯的。 正如你所看到的,在相對佈局內部有一個天文臺和一張桌子,但是天文臺並沒有顯示,甚至沒有空白空間。一個視圖不顯示在相對佈局裏
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/firstLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Chronometer
android:id="@+id/chrono"
android:textColor="#4169E1"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/parentLayout"
android:layout_centerHorizontal="true"
android:text="Chronometer"
/>
<TableLayout
android:id="@+id/parentLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
</TableLayout>
</RelativeLayout>
有什麼想法嗎?
讓你的表格佈局高度WRAP_CONTENT –
只需更改爲最後聲明Chronometer'的'位置,我的意思是先寫'TableLayout'然後'Chronometer' –
謝謝大家的建議,但我相信這個問題是在別的地方,因爲我嘗試了所有你說的,但沒有。 我發佈了一個新的話題與問題.http://stackoverflow.com/questions/24201301/view-not-showing-in-a-relative-layout-in-android – iversoncru