24.12.2010 20:54, John Lussmyer пишет:

The only problem I ran into was making sure there were no forward references in the id's. (Which is why your example had the middle layout at the bottom.) I was just trying to modify my existing layout, and it had the middle in the middle! :-) I had to move it to the bottom of the file so it could reference the bottom panel in it's layout_above entry.

You don't *have* to declare an id where it's first used to identify a view (as opposed to referring to it).

It's perfectly legal to do this:

<View
        *** note the plus sign here ***
    layout_above="@+id/anchor_view"
.../>
<View
    id="@id/anchor_view"
.../>

or even this:

<View
        *** note the plus sign here ***
    layout_above="@+id/anchor_view"
.../>
<View
        *** and here ***
    id="@+id/anchor_view"
.../>

Note that view declaration order in XML is the initial Z-order (top-to-bottom is back-to-front), so sometimes forward references are necessary.

--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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

Reply via email to