I have a UIToolbar.
If I create a UIBarButton like this, it works:
UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithImage:iOB style:UIBarButtonItemStylePlain target:self action:@selector(myStuff)];
[button setTitle:@"Hi"];
If I create the UIBarButton like this, cause I want it to be colored:
UIImageView *vUP = [[UIImageView alloc] initWithImage:iUP];
UIBarButtonItem *UPButton = [[UIBarButtonItem alloc] initWithCustomView:vUP];
[UPButton setAction:@selector(anotherStuff)];
[UPButton setTitle:@"Hi";
[UPButton setTarget:self];
[vUP release];
The button shows, WITHOUT title and will doesn’t respond to any touch…
am I missing something?
If you want image and title both then image must be set as a background image with title.