Specify LinearLayout children width in percentages?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Specify LinearLayout children width in percentages?

Postby markww » Thu Oct 08, 2009 9:24 pm

Hi,

Is it possible to create a horizontal LinearLayout where we specify
how wide percentage-wise each element is? Something like:

LinearLayout ll = new LinearLayout();
ll.add(new TextView("a"));
ll.setViewWidthAtIndex(0, 30);
ll.add(new TextView("b"));
ll.setViewWidthAtIIndex(1, 50);
ll.add(new TextView("c"));
ll.setViewWidthAtIndex(2, 20);

Thanks
markww
Freshman
Freshman
 
Posts: 9
Joined: Sun Feb 24, 2008 7:36 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests