Linear Layout For A Calculator App
I am having a problem on the last row of my linear layout. I want the 0 to be the same size as all the other numbers, and then the other 4 buttons in that row to be like below (thi
Solution 1:
Last LinearLayout consists of two objects: Button and LinearLayout. You want it to be divided: 1 unit for button and 2 units for LL. So you should set button layout_weight="1" and LL layout_weight="2". Set also layout_width="fill_parent" (or "0dp" - should act the same as weight will provide proper weight).
You can also put "R" and "Z" to one LL and "arrow", "search" to second LL. Then you will have three objects the same size so put layout_weight="1" to each of them.
Here is article about using weight parameter: http://developer.android.com/resources/articles/layout-tricks-efficiency.html
Solution 2:
The last line is clearly running out of space. Try using a TableLayout or a RelativeLayout. But using those also, you will probably have space problems.
Post a Comment for "Linear Layout For A Calculator App"