简体   繁体   中英

use of layout_weight without being stretched

I got 7 buttons aligned horizontally in a layout by giving them each a weight of 1. This however stretches the button so the take up the same amount of space on the screen. I need the buttons to remain the good aspect ratio and still take up the whole width by making use of whitespace between the buttons. Is this possible with weight?

If you want to stretch not buttons but space around them, put buttons to containers and set weight to them. Also take a look at TableLayout and GridLayout.

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