双向GridView控件库不能正常工作。 (水平GridView控件) [英] TwoWay GridView library doesn't work properly. (Horizontal GridView)

查看:315
本文介绍了双向GridView控件库不能正常工作。 (水平GridView控件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是想实现以下任务:设置图像,而不是正常的垂直GridView控件的水平GridView的结果
我发现,大多数计算器答案被打靶这个库:结果
https://github.com/jess-anders/two-way-gridview

I was trying to achieve the following task: Setting an horizontal GridView of images instead of the normal vertical GridView.
I found out that most StackOverflow answers were targetting this library:
https://github.com/jess-anders/two-way-gridview

我第一次运行示例项目,它导致了以下内容:

I first ran the sample project and it resulted in the following:

这里是TwoWayGridView布局的XML文件:

Here's the xml File of the TwoWayGridView layout:

 <?xml version="1.0" encoding="utf-8"?>
<com.jess.ui.TwoWayGridView
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="#E8E8E8"
    android:id="@+id/gridview"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"
    app:cacheColorHint="#E8E8E8"
    app:columnWidth="80dp"
    app:rowHeight="80dp"
    app:numColumns="auto_fit"
    app:numRows="auto_fit"
    app:verticalSpacing="16dp"
    app:horizontalSpacing="16dp"
    app:stretchMode="spacingWidthUniform"
    app:scrollDirectionPortrait="vertical"
    app:scrollDirectionLandscape="horizontal"
    app:gravity="center"/>

我也试过这个库链接到我的项目,但结果是一样的。每个图像需要整个行和滚动垂直而不是水平。

I also tried to link this library into my project, but the results are the same. Each image takes the whole row and the scrolling is vertical instead of horizontal.

可能是什么这个问题的原因是什么? (注意:我还没有在示例项目中改变任何东西)。

What could be the reason for that problem? (Note: I haven't changed anything in the sample project).

编辑:这里的导入项目时的屏幕截图:

Here's a ScreenShot when importing the project:

推荐答案

请确保您使用的是我的版本的它,而不是分叉的版本之一。我刚刚下载从GitHub的全新副本,它工作正常。

Make sure you are using my version of it and not one of the forked versions. I just downloaded a fresh copy from github and it works fine.

这篇关于双向GridView控件库不能正常工作。 (水平GridView控件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆