How may I puy into a UIToolbarButton a custom picture characters (like the bookmark one) followed by some text ?
Asked
Active
Viewed 379 times
-1
-
May be this question might help you http://stackoverflow.com/questions/4644606/how-to-display-a-title-and-image-on-uitoolbar-simultaneously – Robin Jun 09 '11 at 05:17
2 Answers
2
Create a UIView
and drop a UIImage
and UITextView
(or UILabel
) on the view. Then add the view to the toolbarbutton.

PengOne
- 48,188
- 17
- 130
- 149
0
To have an image and text for your toolbar button ( I think that's your question) I create a tabBarItem property and alloc init it in a "setup" method. In awakeFromNib I call the "setup" method. Be sure to have your image that you use in your supporting files folder This is how I do it:
@interface YourViewController : UIViewController {
}
@property (retain) UITabBarItem *tabBarItem;
-(void)setup;
@end
@implementation YourViewController
@synthesize tabBarItem;
-(void) setup{
UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:@"theTitleYouWant" image:[UIImage imageNamed:@"yourImage.png"] tag:0];
self.tabBarItem = item;
[item release];
}
@end

brandonbocklund
- 595
- 4
- 11