![](/img/trans.png)
[英]How do I make my scrollbar always visible within tableview iOS(Swift AutoLayout)
[英]How to make scrollbar of TextView always visible in Swift
我在 Collection View Cell 中使用 TextView。 我希望 TextView 在其內容可以滾動時始終顯示滾動指示器。 我在下面使用這種方法。 但它只顯示在它消失之后。 如何讓TextView的滾動指示器一直顯示?
override func draw(_ rect: CGRect) {
super.draw(rect)
self.descriptionTextView.flashScrollIndicators()
}
flashScrollIndicators:它只會在創建 textView 或加載頁面時閃爍一次。
定期設置 flashScrollIndicators:
let timerTask = Timer.scheduledTimer(timeInterval: 0.01, target: self, selector: #selector(refreshFlashIndicator), userInfo: nil, repeats: true)
@objc func refreshCrawlerStatus() {
self.descriptionTextView.flashScrollIndicators()
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.