简体   繁体   中英

Custom Android screen size

I would like to know whether there is such possibility to customize the screen size on Android devices? Something like using half part of the screen and the other half is blank.

For this kind of problems, you can work with percentage. There are 2 common ways:

in java: You can get the display height from your used lcd-panel and then multiply with your number of percents. In this way, you have to format the button in your activity.

in layout xml: You should design your layout within the xml-files and not in java code (my oppinion). Use layout-weight like following post: set position size of ui element as percentage of screen size

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