I agree that a TableLayout can always be replaced with Relative and/or Linear layouts, but I still find it a very convinient shorthand in a lot of cases. It's also a lot more readable than a RelativeLayout and it's also much easier to modify than the nightmare that a RelativeLayout is when are trying to move rows/columns around.
I understand and appreciate that the RelativeLayout is usually the most efficient memory and computation-wise, but it sure is difficult to work with and buggy in some older versions of Android. Another reason I will be dropping 1.5 support soon. On Feb 28, 7:59 am, Jonathan Foley <jonefo...@gmail.com> wrote: > I agree with TreKing. I have never found a situation where I actually > need a TableLayout. They are too restrictive IMO and don't afford > much control over layout. One gets better control using RelativeLayout > or LinearLayout. For the type of weighted proportional layout you're > after, you'll want to use a LinearLayout. It's the only ViewGroup that > observes the layout_weight property. I'd use something like this > skeleton below. This will give you proportional heights of the two > rows and the ImageSwitchers will be laid out proportionally to take up > half the width of each row. This is off the cuff so do check for > sanity! > > <LinearLayout android:orientation="vertical" > android:layout_height="fill_parent" > android:layout_width="fill_parent"> > <LinearLayout android:layout_weight="1" > android:orientation="horizontal" android:layout_height="fill_parent" > android:layout_width="fill_parent"> > > <ImageSwitcher android:layout_height="fill_parent" > android:layout_weight="1" android:layout_width="fill_parent" /> > <ImageSwitcher android:layout_height="fill_parent" > android:layout_weight="1" android:layout_width="fill_parent" /> > </LinearLayout> > > <LinearLayout android:layout_weight="1" > android:orientation="horizontal" android:layout_height="fill_parent" > android:layout_width="fill_parent"> > <ImageSwitcher android:layout_height="fill_parent" > android:layout_weight="1" android:layout_width="fill_parent" /> > <ImageSwitcher android:layout_height="fill_parent" > android:layout_weight="1" android:layout_width="fill_parent" /> > </LinearLayout> > > </LinearLayout> > > Jonathan > > On Feb 27, 2:01 pm, TreKing <treking...@gmail.com> wrote: > > > > > On Sun, Feb 27, 2011 at 3:48 PM, rael_yoni <yoni.stoff...@gmail.com> wrote: > > > That was just another test... that didn't work. > > > Well, do you really a TableLayout in this case? If you just have two rows, > > consider a LinearLayout which might work better. > > > --------------------------------------------------------------------------- > > ---------------------- > > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > > transit tracking app for Android-powered devices- Hide quoted text - > > - Show quoted text - -- 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