开发者

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
      }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜