Issue
The problem I have is that I can't figure out how to create a certain layout without using nested LinearLayouts with weights (cause Android keeps suggesting not to use them). I know that you can use a bit of nested layouts if your logic is to just display info. But I would prefer to find a solution to make my layouts completely responsive for the different screensizes.
I'm developing an application for some specific devices with a screen resolutions between 4.0 and 5.0 inch. I don't mind that on the bigger ones the font type will be smaller orso. I just don't want to make a layout for each device. All the devices are running Android 4.4.X or higher.
One of the layouts I want to achiev is something like this:
For now I made this with a LinearLayout for the blue sections. Then inside each blue layout a linear layout for the red sections. And inside each red section another linear layout for the one where I need to split it into half the width (50%). All of the LinearLayouts are using the logic of weightsum and the children layout_weight.
I tried it already with GridLayout and TableLayout but I'm not getting the result I want.
What is currently the best way to implement the layout for these devices (I don't need it to work for tablets etc)?
Solution
Sdk 23 support library includes layouts that allow for specifying width ans height in percentages, including PercentRelativeLayout, which is probably your best bet here.
See, for example, the currently un-accepted answer at Android complex layout design advise
Answered By - GreyBeardedGeek
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.