I have an app that renders as follows:
The white rectangle is a CardView
. Here is the .xml that renders the activity:
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/designerGrid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0099cc"
android:columnCount="5"
android:rowCount="6"
android:visibility="visible"
tools:context=".visuals.CloudCardActivity">
<!-- Left Control Panel (r:0 c:0 r-span:2 c-weight:2) -->
<LinearLayout
android:id="@+id/leftControlPanel"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_column="0"
android:layout_columnSpan="2"
android:layout_row="0"
android:layout_rowSpan="6"
android:background="#0099cc"
android:gravity="top|center_horizontal"
android:orientation="vertical">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textCapCharacters"
android:text="New" />
</LinearLayout>
<!-- Top Control Panel (r:0 c:1 r-span:1 c-span:3) -->
<LinearLayout
android:id="@+id/topControlPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_columnSpan="3"
android:layout_row="0"
android:background="#0099cc"
android:gravity="left|center_vertical"
android:orientation="horizontal">
<Spinner
android:id="@+id/cardFields"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:entries="@array/default_card_fields">
</Spinner>
</LinearLayout>
<!-- Card View Panel (r:1 c:1 r-weight:8 c-weight:8) -->
<LinearLayout
android:id="@+id/cardLayout"
android:layout_column="2"
android:layout_columnSpan="3"
android:layout_row="1"
android:layout_rowSpan="5"
android:background="#a3a3a3"
android:elevation="3dp"
android:gravity="center_vertical|center_horizontal"
android:visibility="visible">
<android.support.v7.widget.CardView
android:id="@+id/cardView"
android:layout_width="560dp"
android:layout_height="320dp"
android:background="@android:color/white"
android:fadingEdge="horizontal|vertical"
android:focusable="auto"
android:gravity="center_horizontal"
android:layoutMode="clipBounds"
app:cardElevation="5dp" />
</LinearLayout>
</GridLayout>
Sidebar: the background color of the LinearLayout
is not rendering either.
Am I using the right controls for the layout?