UITableView Custom Scrollbar

前端 未结 1 1216
眼角桃花
眼角桃花 2021-01-13 13:25

How can I create a custom scrollbar for a UITableView?

I want to remove the default one that pops up when tracking begins and that disappears when t

1条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-13 13:49

    UITableView inherits from UIScrollView, that means you can use any of the existing functions. In your case

    – (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated

    should do the job. It moves the table to any position you want.

    To disable the existing scroll indicator, use

    table.showsVerticalScrollIndicator = NO;
    

    And to add your own, just add your custom view!

    0 讨论(0)
提交回复
热议问题