+ 1
Android beginner question.
why i cant move my buttons up.press the link and scroll down to see the question. https://plus.google.com/u/1/107321672913287932096
5 Respostas
+ 11
@Oyl, for vertical LinearLayout, if one nested element's width is match_parent, then it'll occupy the whole width of the parent element. So there will be no place for it's sibling elements.
Use the following structure:
Horizontal LinearLayout
Vertical LinearLayout-1
3 Buttons
Vertical LinearLayout-2
3 Buttons
Vertical LinearLayout-3
3 Buttons
(Maintain open and close tags properly)
Here is a sample code for 9 buttons using LinearLayout:
https://code.sololearn.com/WMBUJERVYl88/#html
It won't run in code playground. You can copy and paste it here: http://labs.udacity.com/android-visualizer/
Note: I used layout_weight property here for my convenience. It can be done in different ways.
+ 7
android:gravity should be like this:
android:gravity="top|center_horizontal"
+ 6
What?
+ 1
sorry edited.u can see now
+ 1
i have tried it.it still remains the same.i want it to align with the 3 buttons on the top