[android-developers] Re: Disappearing Views with ListView

2009-07-08 Thread Nikola Miljkovic
By the way...I cannot find any documentation about layout_weight. Can you describe what it means? Thanks, Nikola On Jul 7, 8:39 pm, Nikola Miljkovic niko...@gmail.com wrote: Perfect.  Thanks! On Jul 7, 8:11 pm, Romain Guy romain...@google.com wrote: Hi, Do not use wrap_content on the

[android-developers] Re: Disappearing Views with ListView

2009-07-08 Thread Mark Murphy
Nikola Miljkovic wrote: By the way...I cannot find any documentation about layout_weight. Can you describe what it means? http://developer.android.com/reference/android/widget/LinearLayout.LayoutParams.html For whatever reason, the attribute (layout_weight) is not documented, though the

[android-developers] Re: Disappearing Views with ListView

2009-07-07 Thread Mark Murphy
Nikola Miljkovic wrote: Hello all, I am having a problem with ListViews. After adding a few items to the list and it becomes larger than the layout, my cancel button disappears. Scrolling and everything else on the ListView still work fine, but it replaces the views I have below it.

[android-developers] Re: Disappearing Views with ListView

2009-07-07 Thread Romain Guy
Hi, Do not use wrap_content on the ListView. Instead, use layout_height=0dip and layout_weight=1.0. On Tue, Jul 7, 2009 at 1:53 PM, Nikola Miljkovicniko...@gmail.com wrote: Hello all, I am having a problem with ListViews.  After adding a few items to the list and it becomes larger than the

[android-developers] Re: Disappearing Views with ListView

2009-07-07 Thread Romain Guy
-- fill_parent fill_parent won't work, the button will be pushed out of the screen. -- a fixed height (e.g., 200px) This is a very bad idea to support multiple devices. Do not do this. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions

[android-developers] Re: Disappearing Views with ListView

2009-07-07 Thread Mark Murphy
Romain Guy wrote: -- fill_parent fill_parent won't work, the button will be pushed out of the screen. Yes, I should have mentioned he would need his button to be on top. -- a fixed height (e.g., 200px) This is a very bad idea to support multiple devices. Do not do this. He already had

[android-developers] Re: Disappearing Views with ListView

2009-07-07 Thread Romain Guy
fill_parent won't work, the button will be pushed out of the screen. That would not work either, part of the list would then end up outside of the screen. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to

[android-developers] Re: Disappearing Views with ListView

2009-07-07 Thread Mark Murphy
Romain Guy wrote: fill_parent won't work, the button will be pushed out of the screen. That would not work either, part of the list would then end up outside of the screen. Um, no. ?xml version=1.0 encoding=utf-8? LinearLayout

[android-developers] Re: Disappearing Views with ListView

2009-07-07 Thread Nikola Miljkovic
Perfect. Thanks! On Jul 7, 8:11 pm, Romain Guy romain...@google.com wrote: Hi, Do not use wrap_content on the ListView. Instead, use layout_height=0dip and layout_weight=1.0. On Tue, Jul 7, 2009 at 1:53 PM, Nikola Miljkovicniko...@gmail.com wrote: Hello all, I am having a problem

[android-developers] Re: Disappearing Views with ListView

2009-07-07 Thread Romain Guy
if you put the button at the top yes. But now ListView is too tall and extends out of the screen. layout_weight is the only way to do it. On Jul 7, 2009 6:29 PM, Mark Murphy mmur...@commonsware.com wrote: Romain Guy wrote: fill_parent won't work, the button will be pushed out of the screen.

[android-developers] Re: Disappearing Views with ListView

2009-07-07 Thread Romain Guy
So, I remain fully convinced that ListView with a height of fill_parent works as expected. It should not. That's either a bug in LinearLayout or you gave that ListView a weight. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me,

[android-developers] Re: Disappearing Views with ListView

2009-07-07 Thread Mark Murphy
Romain Guy wrote: So, I remain fully convinced that ListView with a height of fill_parent works as expected. It should not. That's either a bug in LinearLayout or you gave that ListView a weight. Well, it ain't the latter -- I posted the code. -- Mark Murphy (a Commons Guy)

[android-developers] Re: Disappearing Views with ListView

2009-07-07 Thread Romain Guy
I checked the code and it is indeed a bug. fill_parent does not behave the way it really should in LinearLayout in that particular case. If the last item in a LinearLayout is fill_parent, then it will behave (almost) as if it had a weight. Fixing the bug would probably break apps so it won't

[android-developers] Re: Disappearing Views with ListView

2009-07-07 Thread Mark Murphy
Romain Guy wrote: if you put the button at the top yes. But now ListView is too tall and extends out of the screen. Here are two screenshots demonstrating the LinearLayout in my previous post: http://commonsware.com/misc/device2.png http://commonsware.com/misc/device.png The ListView does