【发布时间】:2011-08-17 10:06:04
【问题描述】:
以下是显示工具栏按钮的代码。
UIButton myButton = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *myImage = [UIImage imageNamed:@"img1.png"];
[myButton setBackgroundImage:myImage forState:UIControlStateNormal];
UIBarButtonItem *myToolbarButton = [[UIBarButtonItem alloc] initWithCustomView:myButton];
工具栏上没有显示任何内容。请告诉我有什么问题。
【问题讨论】:
-
可能是因为你没有设置按钮的框架...
标签: ios uibutton uiimage uibarbuttonitem displayobject