Brion Emde wrote: > RelativeLayout makes only a single pass through your XML to > determine the Ids and collect the layout information.
That is not true, as of Android 1.6. It didn't get much publicity, but RelativeLayout now supports forward references. The key is you need to use the + sign on the *first occurrence* of the ID: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5px"> <TextView android:id="@+id/label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="URL:" android:layout_alignBaseline="@+id/entry" android:layout_alignParentLeft="true"/> <EditText android:id="@id/entry" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_toRightOf="@id/label" android:layout_alignParentTop="true"/> <Button android:id="@+id/ok" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/entry" android:layout_alignRight="@id/entry" android:text="OK" /> <Button android:id="@+id/cancel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/ok" android:layout_alignTop="@id/ok" android:text="Cancel" /> </RelativeLayout> Here, the first reference to the ID of "entry" is in: android:layout_alignBaseline="@+id/entry" That means we can skip the + sign in the corresponding android:id attribute: <EditText android:id="@id/entry" So long as you are still targeting Android 1.5, I would not rely upon this. However, once Android 1.5 is in your rear-view mirror, you gain more flexibility. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in NYC: 10-11 April 2010: http://guruloft.com -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en