Unable to stick button at the end of the display

Put your problem here if it does not fit any of the other categories.

Unable to stick button at the end of the display

Postby wrapware » Wed Jan 23, 2008 10:04 am

Hi,

While trying to layout a set of widgets in a LinearLayout inside of a
ScrollView, everything looks fine.

Now I want to place a logout-button below the scrollview, so the button
is IN ANY CASE visible AT THE END OF THE Display area NOT! below the ScrollView.

If there are too many widgets in the scrollview, the slider sould be visible,
to scroll throuth the widgets.



This is the layout (in HVGA-P)

MANY widgets:

1|________________|
2| Filled ||
3| EditText ||
4| Widget ||
5| With Fixed ||
6| Lines ||
7| Attribute ||
8|_______________ ||
9|______Button 1___| <- should be glue'ing like gravity=bottom

(The || represent the slider).



Only SOME widgets (This is what I want):
1|________________|
2| Filled |
3| EditText |
4| Widget |
5|----------------------| <- end of the scroll view
6| |
7| <empty> |
8|_______________ |
9|______Button 1___| <- should be glue'ing like gravity=bottom



This happens wiht Only SOME widgets in my example :
1|________________|
2| Filled |
3| EditText |
4| Widget |
5|----------------------| <- end of the scroll view
6|______Button 1___|
7|
8|
9|

The problem is, my Button1 still hang in line 6 instead the wanted line 9 of my example (remember line9 should be the displays-bottom area.)

Is there a way to define this within the layout for any resolution of displays (means H or V)?

Thanx
Mike
wrapware
Freshman
Freshman
 
Posts: 7
Joined: Thu Jan 17, 2008 7:48 pm
Location: Germany

Top

Postby cabernet1976 » Thu Jan 24, 2008 2:31 am

Hi wrapware,

I have done it successfully (sorry I am unable to paste the code which is not in this PC), please try to do as below:
Put all widgets (except the button) to a layout (i.e. LinearLayout), and remember to set this layout's android:layout_weight="1". But don't set button's android:layout_weight

Please tell me if you are still unluck.
Design the view is a very very unhappy thing :( , right?
Upload2Flickr's blog: http://upload2flickr.blogspot.com
cabernet1976
Senior Developer
Senior Developer
 
Posts: 154
Joined: Fri Nov 16, 2007 2:34 am
Location: China

Postby wrapware » Thu Jan 24, 2008 8:21 am

Hi cabernet1976,

Its exactly what I want!
I had already play around with the android:layout_weight="1", but not in this way.

Now everything works fine.

Thanx alot!
wrapware
Freshman
Freshman
 
Posts: 7
Joined: Thu Jan 17, 2008 7:48 pm
Location: Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 12 guests