Thursday, December 31, 2009

Re: [android-developers] Re: Can someone explain the correct way to use android:layout_toRightOf?

jotobjects wrote:
>
> On Dec 29, 7:02 pm, Jonathan Nalewajek <jonnalewa...@gmail.com> wrote:
>
>> <Button
>> android:id = "@+id/bu5m"
>> android:layout_width="70sp"
>> android:layout_height="wrap_content"
>> android:text = "-5"
>> android:layout_toRightOf="@id/bucm"
>> />
>
> You cannot have a forward reference in the layout. Here bucm is
> later in the layout so that forward reference is not allowed.

Actually, forward references work in Android 1.6+, but you have to put
the + sign on the @+id the *first* time it is encountered. So, in this
snippet, put @+id/bucm in the toRightOf, and when you define the widget
later in the layout, give it an android:id of @id/bucm, and it works.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 1.1 Available!

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate