这个布局是3本书的每一行的架子上。
我目前想出GridView控件来显示书籍和手动添加了架子吧。当有超过9书籍出现的问题和滚动网格时布局被打破了。
任何人都可以给我建议另一种更好的方法来处理这个布局。谢谢
解决方案,而不是我想你应该设置在每个元素的背景
(一个架子)的设置网格容器背景(三级货架)......
它看起来很难在你的情况,因为它会在一排三个图像..所以你需要尝试一些这个开关(位置%3)适配器的getView设置三个不同的图像
或
使用ListView,并且重新设置在数组列表中的数据,使每个元素都有三本书,你可以让所有的三张图片可点击该行,并可以使列表行无法点击和unfocusable
This layout is a shelf with 3 books each row.
I current come up with gridview for displaying the books and manually add up the shelf bar. The problem occurs when there are more than 9 books and the layout is broken when scrolling the grid.
Could anyone suggest me another better way to deal with this layout. Thanks
解决方案I think you should set the background in each element
(one shelf) instead of the setting the Grid container background (three shelf) ....
it's looking difficult in your case because it would has three images in a row ..So you need to try some this switch(position%3) in getView of adapter to set three different image
or
Use the ListView and Re-set the data in Array List so that each element has three books and you can make all three images clickable of that row and can make list row unclickable and unfocusable
相关推荐
最新文章