Android GridView load items vertically

后端 未结 7 1417
离开以前
离开以前 2021-02-05 07:16

Is it possible to load items in GridView with vertical orientation? I mean...

Normal situation - 3 columns

\

7条回答
  •  独厮守ぢ
    2021-02-05 07:40

    I don't think this is possible at all.

    Reason ::

    • There is technical glitch doing this since we want to scroll items vertically. And also the rendering items on the screen is also vertical direction. In this case we can not complete the calculation we need to do in the onLayout and onMeasure Method of the GridView.
    • If try another way i.e some of us has suggested that snuffle the datasource as [1,5,2,6,3,7,4,8, ...] but in this case what would be shuffle algorithm?
    • When user flings vertically then how can you calculate how many items we need to render vertically and when to switch to next column to render the other items. there is no such mathematical formula for it.

    I did some work on this and came to this conclusion.Hope this make unanswered question answered.

提交回复
热议问题