Re: [android-developers] How can I cause a RelativeLayout to re-layout it's children?
Try calling invalidate() on the RelativeLayout. On Mon, Dec 27, 2010 at 8:54 PM, John Lussmyer johnlussm...@gmail.com wrote: I have a RelativeLayout with children. After a while, I want to change the size of one child - which should cause at least one other to move. I can change the childs size, but the other doesn't move. I've tried calling forceLayout(), but that had no effect. Is there some way to get a view to re-layout it's children? -- 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 -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.3 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How can I cause a RelativeLayout to re-layout it's children?
As I mentioned near the start of this thread, I had already tried that. It doesn't always work. The layout would only display the update after doing something else in the app (like clicking another button). On Tue, Dec 28, 2010 at 2:23 AM, Mark Murphy mmur...@commonsware.comwrote: Try calling invalidate() on the RelativeLayout. -- 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
Re: [android-developers] How can I cause a RelativeLayout to re-layout it's children?
invalidate() just causes the views to be redrawn: http://developer.android.com/reference/android/view/View.html#invalidate() requestLayout() asks that the views go through a new measure/layout pass (and then redraw): http://developer.android.com/reference/android/view/View.html#requestLayout() These are also covered in the overview documentation of View, in the Layout and Drawing sections: http://developer.android.com/reference/android/view/View.html http://developer.android.com/reference/android/view/View.html On Tue, Dec 28, 2010 at 7:27 AM, John Lussmyer johnlussm...@gmail.comwrote: As I mentioned near the start of this thread, I had already tried that. It doesn't always work. The layout would only display the update after doing something else in the app (like clicking another button). On Tue, Dec 28, 2010 at 2:23 AM, Mark Murphy mmur...@commonsware.comwrote: Try calling invalidate() on the RelativeLayout. -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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
[android-developers] How can I cause a RelativeLayout to re-layout it's children?
I have a RelativeLayout with children. After a while, I want to change the size of one child - which should cause at least one other to move. I can change the childs size, but the other doesn't move. I've tried calling forceLayout(), but that had no effect. Is there some way to get a view to re-layout it's children? -- 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