views:

2509

answers:

1

iPhone application, which has two buttons -right side- of Navigation Bar title. I want to do this completely using Interface Builder and have had some limited success. The current problem is with buttons using custom image. All built-in images are ok, e.g. Info Light or Add Contact. Custom image just won't get visible.

alt text

Type: custom
Title: (empty)
Image: (empty)
Background: my_image.png

Any ideas what to try? Could it be that my PNG image is somehow wrong? Tried also images, which show ok on Tab bar. Please note that button highligh works ok. Just missing the image... Must be close, right?

alt text

+1  A: 

EDIT: I read your question a bit too quickly the first time. I now see you're using a custom view for the UIBarButtonItem. Are you just simulating this through Interface Builder, or have you tried building your project and running it in the Simulator or on your device? I was able to successfully get a custom image in view in a UIBarButtonItem, though I had to build and run my project before I could see it (simulating it through IB wasn't enough).

hjon
Happy to hear custom image is possible, I was losing faith :)Run only in simulator, not real device. I have 2.2.1 in device, while project requires 3.0 SDK. Now I think I'll temporarily get rid of 3.0 dependency to see this in real device. Don't want to upgrade iPhone OS, want to keep older version to make sure sw is backwards compatible. PITA, but don't know any other way to check that...
JOM
When I tried it, I used 3.0 on the Simulator. Are you able to make your PNG available? From your screenshot, it looks like you're doing it right (although I think I would have it be the image instead of the background image).
hjon
You were right, IB Simulator as well as iPhone Simulator were not able to show the custom icon, but on real device it was ok (just got to finetune my graphics). Many thanx for support!
JOM
Not a problem. Glad to hear you got it working!
hjon