Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 18, 2008, 10:51 AM   #1
darkpegasus
macrumors newbie
 
Join Date: Jul 2008
UIBarButtonItem Image not showing

I have a UIBarButtonItem that I am trying to create with initWithImage. However, whenever I run the app I get a small button with a blank white box instead of the image. Am I missing something?

UIBarButtonItem *myToolbarItem = [[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"myImage.png"]
style:UIBarButtonItemStyleBordered
target:self
action:nil] autorelease];
darkpegasus is offline   0 Reply With Quote
Old Jul 18, 2008, 02:11 PM   #2
grimjim
macrumors member
 
Join Date: May 2003
This snippet of the UIBarButtonItem documentation might have some bearing on it:
Quote:
The alpha values in the source image are used to create the images—opaque values are ignored
So, if your image is rectangular and opaque, all you will see is the rectangle. Try using an image with an alpha channel, and you should get better results.
grimjim is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iPad Mini: Multitasking Image Showing Deleted Film NOTmacbookpro13 iPad 6 Jan 10, 2014 12:57 PM
Some Retina iPad Minis Showing Image Retention Issues MacRumors MacRumors.com News Discussion 218 Nov 27, 2013 06:16 PM
Contact Image not showing soamz iPhone 0 Aug 30, 2013 04:15 AM
Why Is My Image Not Showing Up (From Web Service) loon3y iPhone/iPad Programming 0 Sep 18, 2012 11:40 AM
Airplay NOT showing image zerobrand OS X 10.8 Mountain Lion 1 Jul 13, 2012 07:57 PM

Forum Jump

All times are GMT -5. The time now is 12:49 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC