[Solved] xml – How to convert Windows Phone 8.1 layout to Android? [closed]


I want 2nd row to take space according to its items inside it and rest of space should be given to first row.

In that case it is down to the children to decide how much space they take as the grid view just defines the overall container for all items

<GridLayout android:id="@+id/the_grid"
            android:rowCount="2" android:columnCount="2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

    <ImageView android:layout_height="wrap_content"
               android:layout_width="wrap_content" />
    <TextView  android:layout_height="wrap_content"
               android:layout_width="wrap_content" />

    <ImageView android:layout_height="match_parent"
               android:layout_width="wrap_content" />
    <TextView  android:layout_height="match_parent"
               android:layout_width="wrap_content" />

</GridLayout>

Alternatively, you may find it works better with linear layouts, but then in order to make sure the top row stays as a row, you would have to use fixed height

<LinearLayout android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

    <LinearLayout android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
        <ImageView android:layout_height="56dp"
               android:layout_width="wrap_content" />
        <ImageView android:layout_height="match_parent"
               android:layout_width="wrap_content" />
    </LinearLayout>

    <LinearLayout android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
        <TextView  android:layout_height="56dp"
               android:layout_width="wrap_content" />
        <TextView  android:layout_height="match_parent"
               android:layout_width="wrap_content" />
    </LinearLayout>

</LinearLayout >

3

solved xml – How to convert Windows Phone 8.1 layout to Android? [closed]