在拖动表格之前,在UITableView中显示滚动条。在某种程度上,UIScrollBar应始终可见 [英] Show scrollbar in UITableView before the table is dragged down. In a Way, the UIScrollBar should always be visible

查看:103
本文介绍了在拖动表格之前,在UITableView中显示滚动条。在某种程度上,UIScrollBar应始终可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用中使用了几个 UITableView 。其中一些包含几行,而一些只有两个。我需要的是:如果表包含多行,那么在用户甚至拖动表格之前,滚动条应该是可见的。
或者换句话说,是否可以使滚动条始终可见?

In a I am using several UITableView in my app. Some of them contain several rows, while some have two three only. What I need is: if the table contains several rows, then the scrollbar should be visible before the user even drags the table down. Or in another way, is it possible to make scrollbar visible always??

推荐答案

你可以闪现但是那里不能让它们始终可见:

You can flash them but there isn't an option to make them always visible:

[ScrollView flashScrollIndicators];




UITableView是UIScrollView的子类,所以你可以直接使用它它

UITableView is a subclass of UIScrollView,So you can use it directly with it



  - (void)viewDidAppear:(BOOL)animated {
      [super viewDidAppear:animated];
      [self.tableView performSelector:@selector(flashScrollIndicators) withObject:nil afterDelay:0];
}

查看更多信息:
UIScrollView - 显示滚动条

Swift:

override func viewDidAppear(animated: Bool) {
    super.viewDidAppear(animated)
    self.tableView.flashScrollIndicators()   
}

这篇关于在拖动表格之前,在UITableView中显示滚动条。在某种程度上,UIScrollBar应始终可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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