Use public LinearLayout.LayoutParams (int width, int height, float weight)For your reference
http://developer.android.com/reference/android/widget/LinearLayout.LayoutParams.html - Anurag Singh On Tue, May 4, 2010 at 4:17 PM, rajesh chandrasekaran < [email protected]> wrote: > Hi all > > I am new in android, i am having few problem in layout alignment.I > have divide the screen into three layout,as header, body and footer. > > I am giving the height dynamically for the three layout in java file, > so i need to give 12% of height to header and footer layout, and the > remaining 75% i need to assign height to body layout. > > For that i have made the calculation as follow > > first i am getting the height and width for the screen. With the help > of the screen height i am getting the 12.5% height for header and > footer layout > > WindowManager w = getWindowManager(); > Display d = w.getDefaultDisplay(); > int totalwidth_screen = d.getWidth(); > int totalheight_screen = d.getHeight(); > > > int total_HF_screen = (int) ((12.5/100)*totalheight_screen); # height > for header and footer > int total_body_screen = totalheight_screen - (2*(total_HF_screen)) > #height for body > > By assigning the width and height for the layout using the above > calculations, iam not getting the footer layout properly.i.e only some > part of the footer is viewable. > > I need to assign the height for the layout dynamically, which is not > comming using the above calculation.Can you please suggest me the apt > way of calculation for dynamically assigning the height of the > layout. > > > > > Thanks > C.Rajesh > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

