简体   繁体   中英

how to make layout support all screens in android studio

I'm working on app,in which there are tests for exams.The layout is easy to learn: A simple TextView for Question. below Question there is radioGroup with four radio buttons for alternative answers.below radiogroup there is button for next question. When I test it on Nexus 5 with resolution 1080:1920 it works fine. But i tried and tested it on another emulator with smaller resolution.the problem is that there are some questions with long alternative answers and the radiogroup fit the whole screen so the next button is hiden. I tried small font for the radio buttons but it does not work. What I want is any ideas how to support all screens resolutions. I want to do it without using scrollView.Any ideas?

You basically needs to set your app UI based on every screen class 在此处输入图片说明 click on the highlighted button/tab there u will find set screen size and just set sizes and you will be done

You can add a weightsum to your principal layout and add weight for every element.

Ex : if you put in the main layout the weight sum at 100, you can put 40 weight for your text, 40 for your radio group and 20 for the continue button, it's like percentage.

This will keep the size for every device

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM