Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid layout vertical/horizontal weight
    text
    copied!<p>I use Androids <code>LinearLayout</code> for each device's different resolution. This way I solve vertical layout problem different resolution.</p> <p>But I can't solve horizontal layout problem. Ihis is my layout. I want build layout like this. </p> <p><img src="https://i.stack.imgur.com/2KdkP.png" alt="enter image description here"></p> <p>In this case I use margin left / right but this is not work on different resolution. How to place <code>TextView</code> relate on resolution?</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/LinearLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/titleView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="9" android:gravity="center" android:text="TextView" android:textColor="#5a5856" android:textSize="35sp" /&gt; &lt;TextView android:id="@+id/wordDafinitionView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="3" android:textSize="17sp" android:layout_marginLeft="25dp" android:layout_marginRight="30dp" android:text="TextView" android:textColor="#5a5856" /&gt; &lt;TextView android:id="@+id/TextView01" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="9" android:gravity="center" android:text="TextView" android:textColor="#5a5856" android:textSize="35sp" /&gt; &lt;/LinearLayout&gt; </code></pre>
 

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