Android: GridLayout spacing between items

烈酒焚心 提交于 2019-12-01 14:38:42

问题


I have a grid layout which is filled with buttons, now i want the buttons to be more distant from each other, what code should i write? i tried to search it but only found a solution for GridView, not GridLayout.


回答1:


You can put margin to the buttons




回答2:


Instead of adding margin to each buttons, use android:useDefaultMargins="true"

It is better than adding margin to each buttons!



来源:https://stackoverflow.com/questions/35270404/android-gridlayout-spacing-between-items

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!