I wanted to create a LinearLayout for my Android App with text and tables in it.
The TextView is displayed but the TableLayout is hidden or something like that.
I can’t figure out, what the problem is.
Here’s some code of my layout:
<LinearLayout
android:id="@+id/ListWrapper"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical"
android:orientation="horizontal"
android:layout_gravity="top"
android:background="@color/listBackground" >
<TextView
android:id="@+id/aboutScreenMainText"
android:text="@string/helpPage.mainText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:layout_gravity="top"
android:textColor="#000" />
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableRow
android:layout_width="fill_parent"
android:layout_height="50dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/helpPage.addNoteText" />
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="@color/mainTextColor">
</View>
</TableRow>
</TableLayout>
</LinearLayout>
The problem’s solution was so easy 😉
The Layout’s orientation was “horizontal” and not “vertical”.