Problem in Layout

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

Problem in Layout

Postby nithin.warier » Tue Dec 22, 2009 5:07 pm

Hi,

I have three layouts in my screen. One topLayout, bottomLayout and the centerLayout. CenterLayout is a scrollable layout, in such a way that the center part is scrollable and top and bottomLayout are filxed. I am using linearLayout. Its all working except the bottom layout. For bottom layout , i put in the layoutParams gravity=BOTTOM. BUt its not working.

I tried with relativeLayout also, in that the scrollable part is not working fine.Scrollbar as to be at the edge of the screen. In relative, its coming after view. I tried with width=FILL_PARENT.

I am doing all this in java code, not in xml.

Any suggestions is much appreciated.

Nithin
smartandroidians.blogspot.com
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Top

Postby achie1266 » Tue Dec 22, 2009 5:44 pm

Hi nithin
can you post the code snippet for how you are setting the layout?
and did uou try setting layout_weight=1 for the list view?
achie
User avatar
achie1266
Master Developer
Master Developer
 
Posts: 223
Joined: Mon Nov 09, 2009 10:56 pm
Location: Denver

Postby nithin.warier » Thu Dec 24, 2009 1:07 pm

Somehow solved the issue. I gave proper weight to the 3 layouts and now displaying all 3. Only the middle layout is scrolling, other 2 are fixed and displaying.

Nithin
smartandroidians.blogspot.com
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Postby achie1266 » Thu Dec 24, 2009 10:43 pm

It should also work even if you remove the weights for top and bottom layouts and give the weight of the middle layout as 1. But I think it has to be a linear layout for it to do it. So you may have to put your scroll view in a linear layout and give its weight as 1. This is just another option.
But since you already got it to work without increasing the tree height, I guess yours is probably a better approach.
achie
User avatar
achie1266
Master Developer
Master Developer
 
Posts: 223
Joined: Mon Nov 09, 2009 10:56 pm
Location: Denver

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 8 guests