Thursday, July 14, 2011

How to add blue NavigationBar button ? (programmatically)


You want to add a button looking like this on your navigationBar.

Courtesy


    UIButton *confirmSButton = [UIButton buttonWithType:102]; 
    [confirmSButton addTarget:self action:@selector(confirmButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
    [confirmSButton setTitle:@"Confirm" forState:UIControlStateNormal];
    UIBarButtonItem  *button = [[UIBarButtonItem alloc] initWithCustomView:confirmSButton];
    navBar.rightBarButtonItem = button;
    
    
    


Where navBar is navigationBar.


More Information HERE and HERE about numbers like 101,102, 103.

No comments:

Post a Comment