Swift - 如何将栏附加到表格视图的顶部? [英] Swift - How to attach bar to the top of table view?
问题描述
我有一个位于地图视图顶部的表格视图.看起来像这样:
I've got a table view which is situated on top of mapview. It looks like that:
我想知道如何在表格视图的顶部附加某种栏,以便指示表格是可滚动的.像箭头朝上的细条.我目前没有合适的资产,但我想知道如何做到这一点.我没在论坛里找到这样的帖子.
I wonder how to attach some kind of bar on top of the table view so it indicates that the table is scrollable. Something like thin bar with arrow directed up. I don't have appropriate asset at the moment, but I'd like to know how to do that. I failed to find such thread in the forum.
在故事板中进行操作可能会很乏味,因为表格视图覆盖了主视图的所有区域.所以我想通过程序化方法来做到这一点会更容易.
Doing it in storyboard could be tedious since the table view covers all of the area of main view. So I guess it would be easier to do that by programmatic apprach.
您能否建议如何解决此类问题?
Could you suggest how to approach such problem?
提前致谢.
推荐答案
当表格视图显示在屏幕上时,您可以使用 flashScrollIndicators() 暂时显示它们在这里查看:https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIScrollView_Class/index.html#//apple_ref/occ/instm/UIScrollView/flashScrollIndicators
You can show them momentarily when the table view shows on the screen with flashScrollIndicators() check here : https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIScrollView_Class/index.html#//apple_ref/occ/instm/UIScrollView/flashScrollIndicators
这篇关于Swift - 如何将栏附加到表格视图的顶部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!