Note that there are some explanatory texts on larger screens.

plurals
  1. POImage is not getting added on UIBarButtonItem in iPhone
    primarykey
    data
    text
    <p>I am trying to add the image on to the UIBarButtonItem .But it is not getting added I don't what's going wrong in it this my code</p> <pre><code>-(void)viewDidLoad { UIToolbar *tools = [[UIToolbar alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 103.0f, 44.01f)]; // 44.01 shifts it up 1px for some reason //tools.clearsContextBeforeDrawing = YES; //tools.clipsToBounds = YES; //tools.tintColor = [UIColor colorWithWhite:0.305f alpha:0.0f]; // closest I could get by eye to black, translucent style. // anyone know how to get it perfect? //tools.barStyle = -1; // clear background NSMutableArray *buttons = [[NSMutableArray alloc] initWithCapacity:3]; // Create a standard refresh button. bi = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"map.png"] style:UIBarButtonItemStylePlain target:self action:@selector(changeMapType:)]; [buttons addObject:bi]; [bi release]; // Create a spacer. bi = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; bi.width = 12.0f; [buttons addObject:bi]; [bi release]; // Add profile button. bi = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"map.png"] style:UIBarButtonItemStylePlain target:self action:@selector(goToProfile)]; bi.style = UIBarButtonItemStyleBordered; [buttons addObject:bi]; [bi release]; // Add buttons to toolbar and toolbar to nav bar. [tools setItems:buttons animated:NO]; [buttons release]; twoButtons = [[UIBarButtonItem alloc] initWithCustomView:tools]; [tools release]; self.navigationItem.rightBarButtonItem = twoButtons; [twoButtons release]; } </code></pre> <p>Thank you </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload