简体   繁体   中英

how to customize scroll color of tableview in iphone sdk?

I want to set scroll style to pink color in tableview.please give any suggestion for that.

but only available from this colors

    [tableview setIndicatorStyle:UIScrollViewIndicatorStyleWhite];

Replace UIScrollViewIndicatorStyleWhite to anything from this typedef.

      typedef enum {
            UIScrollViewIndicatorStyleDefault,
            UIScrollViewIndicatorStyleBlack,
            UIScrollViewIndicatorStyleWhite
      } UIScrollViewIndicatorStyle;

For the moment is not possible set a custom color in the Scroll. the only posible colors are white and black.

http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIScrollView_Class/Reference/UIScrollView.html#//apple_ref/doc/uid/TP40006922-CH3-SW5

This code works for me, Swift-3

 override func scrollViewDidScroll(_ scrollView: UIScrollView) {
        let verticalIndicator = scrollView.subviews.last as? UIImageView
        verticalIndicator?.image = nil
        verticalIndicator?.backgroundColor = UIColor.red
      }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM