This is more out of curiosity than anything else, as I have solved my original problem. I wanted a button the horizontal centre of the screen, with a text box to the left of it, using a Relative Layout. I am curious to know why if I have the following layout:
<Button android:id="@+id/pickTime"
android:layout_width="wrap_content"
android:layout_below="@id/to_button"
android:layout_centerHorizontal="true"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/timetext"
android:layout_width="wrap_content"
android:layout_below="@id/to_button"
android:layout_toLeftOf="@id/pickTime"
android:layout_alignTop="@id/pickTime"
android:layout_height="wrap_content"/>
The TextView is not displayed, yet if I subsitute:
android:layout_toLeftOf="@/id/pickTime"
to
android:layout_alignParentLeft="true"
It does display (albeit left justified to the left margin rather than right justified to the to the button which I was originally expecting). Is this an issue with all Relative Layouts (i.e always have to define widgets in a set order), or is it just something to do with text needing to be read from the left?