Wednesday, June 5, 2013

UIScrollView UIScrollViewIndicatorStyleBlack example in Objective C (iOS).


UIScrollView UIScrollViewIndicatorStyleBlack


Scroll Indicator Style
The style of the scroll indicators. You use these constants to set the value of the indicatorStyle style.

typedef enum {
UIScrollViewIndicatorStyleDefault,
UIScrollViewIndicatorStyleBlack,
UIScrollViewIndicatorStyleWhite
} UIScrollViewIndicatorStyle;

Constants
UIScrollViewIndicatorStyleDefault
The default style of scroll indicator, which is black with a white border. This style is good against any content background.
UIScrollViewIndicatorStyleBlack
A style of indicator which is black and smaller than the default style. This style is good against a white content background.
UIScrollViewIndicatorStyleWhite
A style of indicator is white and smaller than the default style. This style is good against a black content background.

UIScrollView UIScrollViewIndicatorStyleBlack example.
UIScrollView* scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 35, self.frame.size.width, self.frame.size.height-35)];
[self.scrollView setScrollEnabled:YES];
[self.scrollView setDelegate:self];
 self.scrollView.backgroundColor = [UIColor clearColor];
 [self.scrollView setShowsHorizontalScrollIndicator:NO];
 [self.scrollView setIndicatorStyle: UIScrollViewIndicatorStyleBlack];
 scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
 scrollView.contentMode = UIViewContentModeScaleToFill;
 [self.scrollView setContentSize:CGSizeMake("GIVE YOUR WIDTH",0)];
[self.view addSubview:scrollView];

Example of [UIScrollView UIScrollViewIndicatorStyleBlack].
scrollview=[[UIScrollView alloc]initWithFrame:CGRectMake(0,80,320,360)];
[scrollview setContentSize:CGSizeMake(2550,360)];
[scrollview setScrollEnabled:YES];
[scrollview setPagingEnabled:YES];
[scrollview setBackgroundColor:[UIColor clearColor]];
scrollview .indicatorStyle = UIScrollViewIndicatorStyleBlack;
scrollview.showsHorizontalScrollIndicator = NO;
scrollview.showsVerticalScrollIndicator = NO;
scrollview.scrollsToTop = NO;
scrollview.delegate = self;
scrollview.tag=500;
[self.view addSubview:scrollview];

UIScrollView UIScrollViewIndicatorStyleBlack example.
[self->scrollView setScrollEnabled:YES];
[self->scrollView setDelegate:self];
self->scrollView.backgroundColor = [UIColor clearColor];
[self->scrollView setShowsHorizontalScrollIndicator:NO];
[self->scrollView setIndicatorStyle: UIScrollViewIndicatorStyleBlack]; scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
scrollView.contentMode = UIViewContentModeScaleToFill;
[self->scrollView setContentSize:CGSizeMake(1300.0,0)];
[self.view addSubview:scrollView];

End of UIScrollView UIScrollViewIndicatorStyleBlack example article.