Just so you know, a quick search on StackOverflow gave me a possible solution: http://stackoverflow.com/questions/3224193/set-the-layout-weight-of-a-textview-programmatically
---------------------------------------------------------------------- There are only 10 types of people in the world... Those who know binary and those who don't. ---------------------------------------------------------------------- On Mon, Jul 26, 2010 at 2:57 PM, Justin Anderson <janderson....@gmail.com>wrote: > Hmmm... that is interesting. Why can't you just do it through the XML > though? > > > ---------------------------------------------------------------------- > There are only 10 types of people in the world... > Those who know binary and those who don't. > ---------------------------------------------------------------------- > > > On Mon, Jul 26, 2010 at 1:08 PM, coldskull <dhodap...@gmail.com> wrote: > >> Thanks! it worked. Only thing i am not sure of now is how to set the >> weight of a Button programmatically instead of thru the xml. >> I could not see any setWeight method and the LayoutParams class also >> does not have the weight param. >> >> >> >> On Jul 26, 10:56 am, Justin Anderson <janderson....@gmail.com> wrote: >> > Use a LinearLayout or RelativeLayout and set the weight of each item to >> the >> > same value... like 1. >> > >> > ---------------------------------------------------------------------- >> > There are only 10 types of people in the world... >> > Those who know binary and those who don't. >> > ---------------------------------------------------------------------- >> > >> > >> > >> > On Mon, Jul 26, 2010 at 10:53 AM, coldskull <dhodap...@gmail.com> >> wrote: >> > > Hello >> > >> > > I have been trying to do a simple layout for sometime now I still >> > > haven't figured it out. >> > >> > > Basically, I want to show four imagebuttons of equal size on the >> > > screen >> > > (each button 1/4th the size of the screen). Sort of like the picsquare >> > > logo (www.picsquare.com). >> > >> > > I am trying to avoid absolute pixel sizes in the code so that it works >> > > on any display size/orientation. >> > >> > > Appreciate any inputs... >> > >> > > Thanks, >> > > chinmay >> > >> > > -- >> > > You received this message because you are subscribed to the Google >> > > Groups "Android Beginners" group. >> > >> > > NEW! Try asking and tagging your question on Stack Overflow at >> > >http://stackoverflow.com/questions/tagged/android >> > >> > > To unsubscribe from this group, send email to >> > > android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com><android-beginners%2Bunsubscr >> i...@googlegroups.com> >> > > For more options, visit this group at >> > >http://groups.google.com/group/android-beginners?hl=en >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Beginners" group. >> >> NEW! Try asking and tagging your question on Stack Overflow at >> http://stackoverflow.com/questions/tagged/android >> >> To unsubscribe from this group, send email to >> android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com> >> For more options, visit this group at >> http://groups.google.com/group/android-beginners?hl=en >> > > -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en