Note that there are some explanatory texts on larger screens.

plurals
  1. PORelativeLayout doesn't display all my widgets
    primarykey
    data
    text
    <p>I'm trying to use RelativeLayout to display a map tile, surrounded by directional buttons, in a simple dialog.</p> <p>I've tried a few variations, but inevitably, some of my buttons are missing.</p> <p>In this version of the example, the <code>up</code> and <code>left</code> buttons are missing. If I declare the <code>up</code> button first and place the <code>tile</code> button relative to it, then <code>up</code> shows. Do RelativeLayouts require the topmost widget to be declared first? Guess not, there would be no use for <code>layout_above</code> then...</p> <p>I can't post images (low rep), but you can view the result <a href="http://emberapp.com/paour/images/emulator" rel="nofollow" title="here">here</a>.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;ImageView android:id="@+id/tile" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="5px" android:layout_centerInParent="true" android:src="@drawable/loading" /&gt; &lt;Button android:id="@+id/up" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@id/tile" android:layout_centerHorizontal="true" android:drawableLeft="@drawable/up" /&gt; &lt;Button android:id="@+id/left" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/tile" android:layout_centerVertical="true" android:drawableLeft="@drawable/left" /&gt; &lt;Button android:id="@+id/right" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/tile" android:layout_centerVertical="true" android:drawableLeft="@drawable/right" /&gt; &lt;Button android:id="@+id/down" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/tile" android:layout_centerHorizontal="true" android:drawableLeft="@drawable/down" /&gt; &lt;Button android:id="@+id/in" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/tile" android:layout_alignParentLeft="true" android:text="@string/test_in" /&gt; &lt;Button android:id="@+id/out" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/tile" android:layout_alignParentRight="true" android:text="@string/test_out" /&gt; &lt;/RelativeLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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