ios Changing UIScrollView scrollbar color to different colors

后端 未结 17 2441
我在风中等你
我在风中等你 2020-12-05 07:16

How can we change color of UIScrollview\'s scroll indicator to something like blue, green etc.

I know we can change it to white, black. But other then these colors.

17条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-05 07:32

    I ran into the same problem recently so I decided to write a category for it.

    https://github.com/stefanceriu/UIScrollView-ScrollerAdditions

    [someScrollView setVerticalScrollerTintColor:someColor]; 
    [someScrollView setHorizontalScrollerTintColor:someColor];`
    

    It blends it with the original image so only the color will change. On the other hand, it can also be modified to provide a custom image for the scrollers to use.

提交回复
热议问题