Note that there are some explanatory texts on larger screens.

plurals
  1. POtwo linear layouts in the same screen
    primarykey
    data
    text
    <p>hi im trying to design my app for both android phone and tablet. So i already had it designed but needed to redesign for scaling purposes for different screens. </p> <p><img src="https://i.stack.imgur.com/RHzIx.png" alt="enter image description here"></p> <p>This is the layout im going for. </p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/LinearLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="@color/white"&gt; &lt;LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:weightSum="2" android:orientation="horizontal" &gt; &lt;fragment android:id="@+id/map" android:layout_marginTop="5dp" android:layout_weight=".1" android:layout_width="wrap_content" android:layout_height="wrap_content" class="com.google.android.gms.maps.MapFragment" /&gt; &lt;Button android:id="@+id/button3" android:layout_weight=".25" android:layout_marginLeft="34dp" android:layout_marginTop="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="ClickTourismButton" android:text="@string/Tourism" /&gt; &lt;Button android:id="@+id/button4" android:layout_weight=".25" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="34dp" android:text="@string/Nearby" /&gt; &lt;Button android:id="@+id/button2" android:layout_weight=".25" android:layout_marginLeft="34dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/Favourites" /&gt; &lt;Button android:id="@+id/button1" android:layout_weight=".25" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="34dp" android:text="@string/Map" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/linearLayout2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:weightSum="2" android:orientation="horizontal" &gt; &lt;TextView android:layout_marginLeft="10dp" android:layout_marginTop="5dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textIsSelectable="true" android:id="@+id/feedupdate1" /&gt; &lt;ListView android:id="@android:id/list" android:background="@color/red" android:layout_weight="1" android:layout_marginTop="5dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp"/&gt; &lt;TextView android:id="@+id/empty" android:textIsSelectable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_marginTop="5dp"/&gt; &lt;TextView android:id="@+id/feedupdate" android:layout_marginLeft="6dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="430dp" android:textIsSelectable="true"/&gt; &lt;ListView android:id="@+id/list1" android:background="@color/blue" android:layout_weight="1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="430dp" android:layout_marginLeft="6dp" /&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; </code></pre> <p>When i run the app the two linear layouts are on top of each other?? or the map fragment which is seen above as the black rectangle takes up all the screen??? Ive no idea what im doing wrong, ive looked through several tutorials and t seems right?</p> <p>Need assistance please</p> <p>thanks</p> <hr> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/LinearLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" android:weightSum="2" android:background="@color/white"&gt; &lt;LinearLayout android:id="@+id/linearLayout1" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:orientation="vertical" &gt; &lt;fragment android:id="@+id/map" android:layout_marginTop="5dp" android:layout_width="wrap_content" android:layout_height="wrap_content" class="com.google.android.gms.maps.MapFragment" /&gt; &lt;Button android:id="@+id/button3" android:layout_marginLeft="34dp" android:layout_marginTop="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="ClickTourismButton" android:text="@string/Tourism" /&gt; &lt;Button android:id="@+id/button4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="34dp" android:text="@string/Nearby" /&gt; &lt;Button android:id="@+id/button2" android:layout_marginLeft="34dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/Favourites" /&gt; &lt;Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="0dp" android:layout_marginLeft="34dp" android:text="@string/Map" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/linearLayout2" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:orientation="vertical" &gt; &lt;TextView android:layout_marginLeft="10dp" android:layout_marginTop="5dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textIsSelectable="true" android:id="@+id/feedupdate1" /&gt; &lt;ListView android:id="@android:id/list" android:background="@color/red" android:layout_marginTop="5dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp"/&gt; &lt;TextView android:id="@+id/empty" android:textIsSelectable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_marginTop="5dp"/&gt; &lt;TextView android:id="@+id/feedupdate" android:layout_marginLeft="6dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="430dp" android:textIsSelectable="true"/&gt; &lt;ListView android:id="@+id/list1" android:background="@color/blue" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="430dp" android:layout_marginLeft="6dp" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p><img src="https://i.stack.imgur.com/aqo19.png" alt="enter image description here"></p> <p>one component takes up each side?? its divided in two but the map fragment takes up all of one side and the first listview takes up all of the other???</p>
    singulars
    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.
 

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