如何打破多个列cardview使所有的内容部分可见? [英] How to break a cardview in multiple columns to make all the content visible in parts?

查看:665
本文介绍了如何打破多个列cardview使所有的内容部分可见?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作,需要一个交货屏幕中,我必须展示在Cardview列表的列数全部订单的POS系统。

I am working on a POS system which needs a delivery screen in which, I have to show all orders in number of columns of list in Cardview.

喜欢的东西显示此图像中:

Something like shown in this image:

我使用 cardslib 让我的应用程序的cardsview。能否请你帮我实现与cardslib这种类型的布局。或者你可以建议我什么会我必须做我的应用程序有这个还挺布局?

I am using cardslib to get the cardsview in my app. Can you please help me to implement this type of layout with cardslib. Or Can you suggest me what will I have to do to have this kinda layout in my app??

我也试过 twowayview 但不能得到的想法在多个列破卡就像上面图片出示黄牌。请帮我..

I also tried twowayview but couldn't get the idea for breaking the card in multiple columns just like the yellow card shown in above image. Please help me..

推荐答案

最后,我找到了这个查询解决办法。我发现了一个 twoway-的GridView的lib 这也帮助我在垂直方向添加数据和滚动水平。我通过根据屏幕尺寸保持的行数和列数的常量使用该库,并在GridView中提到他们。以下code是从上述文库中使用的

Finally, I found a workaround for this query. I found a twoway- gridview lib which did help me to add data vertically and scroll horizontally. I used this library by keeping number of rows and columns constants according to screen size and referred them in gridView. Following code is the one which is used from the above library.

<com.jess.ui.TwoWayGridView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/horz_gridview"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:background="#FFC4C4C4"
    app:cacheColorHint="#E8E8E8"
    app:verticalSpacing="-4dp"
    app:horizontalSpacing="0dp"
    app:stretchMode="none"
    app:scrollDirectionPortrait="horizontal"
    app:scrollDirectionLandscape="horizontal"
    app:gravity="center"
    android:layout_gravity="center"/>

然后,只要布局,填补GridView中的每个单元有。必须创建适配器来填充相应内容网格的每个单元格。

Then, Just make a layout to fill each cell of gridView with. You have to create an adapter to fill each cell of the grid with respective content.

我只是认为网格的每个单元都会有鉴于单行。没有多行中的单个细胞。要显示的开始和卡结束时,您可以使用不同的背景颜色开始和结束的细胞。

I just assumed that each cell of grid will have single line of the view. No multiple lines in a single cell. To show start and end of a card, You can use different background colors to the starting and ending cells.

在短期:你必须让数据的列表其中U不得不把它放在网格带适配器的帮助

In short: You have to make a List of data which u have to put it in grid with the help of adapter.

您可以参考这个教程使用上面的库。

You can refer this tutorial to use above library.

这篇关于如何打破多个列cardview使所有的内容部分可见?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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