Making UI elements relative to screen size?
问题 Lets say I wanted to make a relative view with two columns of buttons, left and right. Where each button takes up exactly 20% of the screen, separated by 10%, with the remaining border on the sides. But to do this for any screen size. DP I think won't work because how do you know the DP pixel count on each different screen? Basically how do you keep UI's relatively the same and fitting between all devices? 回答1: Short answer: LinearLayout . Long answer is here: Defining a percentage width for