UIScrollView - showing the scroll bar

前端 未结 10 1747
-上瘾入骨i
-上瘾入骨i 2020-11-27 20:32

Possibly a simple one!

Does anyone know how to get the scroll bar of a UIScrollView to constantly show?

It displays when the user is scrolling, so they can s

10条回答
  •  难免孤独
    2020-11-27 21:23

    iOS does not offer the API. But if you really want this, you can add your custom indicator to scroll view and layout it yourself, just as the demo does:

    - (void)layoutSubviews
    {
        [super layoutSubviews];
    
        if (self.showsVerticalScrollIndicatorAlways) {
            scroll_indicator_position(self, k_scroll_indicator_vertical);
        }
    
        if (self.showsHorizontalScrollIndicatorAlways) {
            scroll_indicator_position(self, k_scroll_indicator_horizontal);
        }
    }
    

    The link is https://github.com/flexih/MazeScrollView

提交回复
热议问题