寻找一个UI库,在iOS中展示Data horizo​​ntaly [英] Looking for a UI library to present Data horizontaly in iOS

查看:97
本文介绍了寻找一个UI库,在iOS中展示Data horizo​​ntaly的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道iOS的UI库,它的作用类似于水平的UITabelView?

Does anyone know of a UI Library for iOS, that acts like a horizontal UITabelView?

我想从右到左滚动单元格,而不是从上到下滚动单元格。

I want to scroll cells from right to left and not from up to down.

推荐答案

我有类似的要求:在普通垂直滚动表的单元格中水平滚动表格。

I had a similar requirement: Horizontally scrolling tables in cells of a normal, vertically scrolling table.

我的解决方案:我在外表的单元格中放置了一个标准的UIiew。此视图的变换属性设置为旋转90°,作为铰链,将其内容转向侧面。

My solution: I put a standard UIiew in the outer table's cell. This view had its transform property set to turn by 90°, serving as a "hinge", turning its contents to the side.

在铰链视图中是另一个的UITableView 。由于它包含在转动的视图中,因此它会在屏幕上水平显示。这个内表的单元格包含另一个铰链视图,将其内容转换为-90°,然后回到直立方向。

In the hinge view was another UITableView. Since it is contained in the turned view, it appears horizontally on the screen. The cells of this inner table contained another hinge view, turning their contents -90°, back to the upright orientation.

这可能听起来有点令人困惑,但它给了你水平方向的表格视图的所有优点。如果你将外表视图中的单元格放在你的情况下是不需要的,那就不那么容易了。

This might sound a little confusing, but it gives you all advantages of table views, in horizontal orientation. It's less confusing if you leave out the outer table view with their cells which are not needed in your case.

编辑:来回答评论

表现绝对棒极了。实际上,性能是转向这种方法的主要原因。表视图特别适合显示大型数据集,因为它们只实例化可见视图(单元格)并在滚动后重用它们。桌面视图本身非常轻,并且针对其目的进行了优化。我的数据设置中等大小,我会说(两个维度大约100个项目)和滚动非常顺利。

Performance was definitely great. Actually, performance was the major reason to switch to this approach. Table views are especially great for displaying huge data sets, since they only instantiate visible views (cells) and reuse them after being scrolled out. By itself a table view is quite light weight and very optimized for its purpose. My data sets where middle size, I'd say (about 100 items in both dimensions) and scrolling was perfectly smooth.

除了我关注的性能之外的另一件事是触摸处理。事实证明,表视图(从滚动视图派生)总是正确地检测到手势(在滚动视图中滚动滚动视图并不容易正确)。如果您垂直滑动外部表视图将处理事件,如果您水平滑动内部表获取所有事件。我对框架如何处理这种非标准情况印象深刻。

The other thing besides performance I was concerned about was touch handling. It went out that the table views (which derive from scroll views) always detected the gesture correctly (scrolling a scroll view in a scroll view is not easy to get right). If you swiped vertically the outer table view would handle the events, if you swiped horizontally the inner table gets all the events. I was quite impressed of how well the framework handled this non standard situation.

这篇关于寻找一个UI库,在iOS中展示Data horizo​​ntaly的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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