How to get the number of rows of a GridView?

前端 未结 5 1062
梦如初夏
梦如初夏 2021-02-07 20:53

Is there a way to get the row count of a GridView for Android API Level 8?

5条回答
  •  野的像风
    2021-02-07 21:20

    I solved the lack of getNumColumns in V8, in the case where the number of columns is specified in resource, by declaring an integer resource and using that in the GridView resource and code.

    2
    
    
    
    int cols = getResources().getInteger(R.integer.num_grid_columns);
    

提交回复
热议问题