Re: [android-developers] Re: ClassCastException using element

2010-03-16 Thread Mark Murphy
Neilz wrote: > layout_width="0px" > > > That's all it needed. G. > > > I guess it's just one of the tricks of the trade that you either know > or you don't. I mean, that's not logical, is it?! Let's say you use layout_width="wrap_content" and layout_weight="1". The calculation then goes so

[android-developers] Re: ClassCastException using element

2010-03-16 Thread Mike dg
Nellz, It is somewhat logical. It works as long as you have the width the same across all items. If you use WRAP_CONTENT, then it fails since everything is different sizes and then they all evenly distribute the extra space. Thanks Mike On Mar 16, 10:25 am, Neilz wrote: > layout_width="0px" > >

[android-developers] Re: ClassCastException using element

2010-03-16 Thread Neilz
layout_width="0px" That's all it needed. G. I guess it's just one of the tricks of the trade that you either know or you don't. I mean, that's not logical, is it?! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this grou

Re: [android-developers] Re: ClassCastException using element

2010-03-16 Thread Mark Murphy
Neilz wrote: > Nope, I give up. I've spend way too many hours on this today :-( > > Here's a challenge for anyone who fancies it: > - > > Create a layout which places five buttons across the screen, of > exactly equal size, filling all space, that say "

[android-developers] Re: ClassCastException using element

2010-03-16 Thread Neilz
Nope, I give up. I've spend way too many hours on this today :-( Here's a challenge for anyone who fancies it: - Create a layout which places five buttons across the screen, of exactly equal size, filling all space, that say "One", "2", "3" "Four" "5".

[android-developers] Re: ClassCastException using element

2010-03-16 Thread Neilz
I tried TableLayout, but it didn't really help, as the columns adjusted the size depending on the text in the buttons! I think sticking with LinearLayouts and layoutWeight should get me what I want, I'll just have to keep tinkering. -- You received this message because you are subscribed to the G

Re: [android-developers] Re: ClassCastException using element

2010-03-16 Thread Christoph Renner
Have you considered using TableLayout? I've never used it but it sounds promising for what you want to do. Chrigi On Tue, Mar 16, 2010 at 1:32 PM, Neilz wrote: > I see. Thanks Mark. > > That's frustrating, as View does some really useful things that I > can't get other view types to do. > > Basi

Re: [android-developers] Re: ClassCastException using element

2010-03-16 Thread Mark Murphy
Neilz wrote: > That's frustrating, as View does some really useful things that I > can't get other view types to do. That sentence doesn't make a lot of sense to me, considering that View doesn't do anything other than draw a background, AFAICT. > Basically I'm trying to set up a grid of buttons

[android-developers] Re: ClassCastException using element

2010-03-16 Thread Neilz
I see. Thanks Mark. That's frustrating, as View does some really useful things that I can't get other view types to do. Basically I'm trying to set up a grid of buttons (say 4 * 4 for example), where the buttons are exactly equal in size, regardless of the text within them, and together fill the