Android Tutorial #19: Wrapping items up inside a scroll view / linear layout combo.

preview_player
Показать описание

If you've ever wanted to create a scrollable menu of buttons, then you are about to find out how. I show you how to use the android scrollview, what items you must feed it and the relationship between the scrollview items and the android screen area and layout xml file.

We wrap our buttons in a linear layout, then wrap the scroll view around that - quite simple, but you have to take care.

I also briefly compare linear layouts with the relative layout of the main activity class xml layout file.

If you really wanted to, you could change the whole of the main activity layout to linear, if you changed the entry in the xml declaration from RelativeLayout to Linear
Рекомендации по теме
Комментарии
Автор

Nice tutorial. Great to have clear and easy explanations of what the code is doing. Going to run through your others. Thanks

steveh
Автор

How can I add padding or some space between these buttons?

amgf
Автор

It's nice you don't go straight to the correct solution....you go the "logical" way, which in this environment usually does something whacky. Much better to see what happens if you just fumble along, then how to correct things.

daleplus
visit shbcf.ru