Tuesday, June 4, 2013

UIScrollView showsVerticalScrollIndicator example in Objective C (iOS).


UIScrollView showsVerticalScrollIndicator

A Boolean value that controls whether the vertical scroll indicator is visible.

@property(nonatomic) BOOL showsVerticalScrollIndicator

Discussion of [UIScrollView showsVerticalScrollIndicator]
The default value is YES. The indicator is visible while tracking is underway and fades out after tracking.

UIScrollView showsVerticalScrollIndicator example.
UIScrollView *scroll =  [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
scroll.contentSize = CGSizeMake(320, 480);
scroll.showsVerticalScrollIndicator = YES;
[self.view addSubview:scroll];
[self.view sendSubviewToBack:scroll];

[scroll addSubview:detailsLabel];

Example of [UIScrollView showsVerticalScrollIndicator].
to hide the scroll indicators in an UIScrollView
[tableView setShowsHorizontalScrollIndicator:NO];
[tableView setShowsVerticalScrollIndicator:NO];

scrl.showsHorizontalScrollIndicator=NO;
scrl.showsVerticalScrollIndicator=NO;

UIScrollView showsVerticalScrollIndicator example.
- (void)viewDidLoad
{
    [super viewDidLoad];

    CPGraphHostingView *hostingView = (CPGraphHostingView *)self.view;

    UIScrollView *scroll= [[UIScrollView alloc]
initWithFrame:self.view.frame];
    self.view = scroll;
    [scroll addSubview:hostingView];
    scroll.contentSize = CGSizeMake(self.view.frame.size.width * 3,
self.view.frame.size.height-
self.navigationController.navigationBar.frame.size.height);
    scroll.showsVerticalScrollIndicator = NO;

    graph = [[CPXYGraph alloc] initWithFrame: self.view.bounds];
    // graph configuration
-------------- 

End of UIScrollView showsVerticalScrollIndicator example article.