How to set a cell size in Android grid view?

一世执手 提交于 2019-12-12 18:01:44

问题


I am trying to make a gridview with large icon for an app but I couldn't find any tutorial about modifying a cell size on a grid layout on android. Can anyone give me an example or a link about it please?

Thanks.


回答1:


just like the other adapterViews ,on gridView (which extends adapterView) the size that is determined of the children is based on the size that they want to become , as written in the android API:

An AdapterView is a view whose children are determined by an Adapter.




回答2:


Did you try android:numColumns="2"



来源:https://stackoverflow.com/questions/11003318/how-to-set-a-cell-size-in-android-grid-view

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