ios Changing UIScrollView scrollbar color to different colors

后端 未结 17 2420
我在风中等你
我在风中等你 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:36

    This is how the color of the scroll bar is changed:

        //scroll view  
        UIScrollView *scView = [[UIScrollView alloc] init];  
        scView.frame = self.view.bounds; //scroll view occupies full parent views  
        scView.contentSize = CGSizeMake(400, 800);  
        scView.backgroundColor = [UIColor lightGrayColor];  
        scView.indicatorStyle = UIScrollViewIndicatorStyleBlack;  
        scView.showsHorizontalScrollIndicator = NO;  
        scView.showsVerticalScrollIndicator = YES;  
        scView.scrollEnabled = YES;  
        [self.view addSubview: scView];
    

提交回复
热议问题