Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid. Positioning of 3 blocks in the layout
    primarykey
    data
    text
    <p>This image describes what I need to create: <img src="https://i.stack.imgur.com/deuwD.jpg" alt="enter image description here"></p> <p>This my xml code:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="@drawable/bg" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_vertical|center_horizontal" android:orientation="horizontal"&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="right" /&gt; &lt;/LinearLayout&gt; &lt;!-- Now the block that has to be flexible --&gt; &lt;RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="15dp" android:gravity="center" &gt; &lt;ImageView android:layout_width="350dp" android:layout_height="wrap_content" android:layout_centerHorizontal="true" &gt; &lt;/ImageView&gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;/RelativeLayout&gt; &lt;!-- -------------------------------- --&gt; &lt;RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;ImageButton android:layout_width="70dp" android:layout_height="61dp" android:layout_alignParentLeft="true" android:layout_alignParentBottom="true" &gt; &lt;/ImageButton&gt; &lt;ImageButton android:scaleType="fitCenter" android:layout_width="70dp" android:layout_height="70dp" android:layout_centerHorizontal="true" android:layout_alignParentBottom="true" &gt; &lt;/ImageButton&gt; &lt;ImageButton android:layout_width="65dp" android:layout_height="65dp" android:layout_alignParentRight="true" android:layout_alignParentBottom="true" &gt; &lt;/ImageButton&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>The block, that has to stretch contains in ImageView and TextView. So my question is - how to make this middle block to be flexible but keep two other blocks, at the top and at the bottom to stay there on any screen height? The middle block will be stretching.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload