在我的xib文件中有一個欄按鈕項。
.H:
@property (nonatomic, retain) IBOutlet UIBarButtonItem *toolbarButton;
.M:
UIButton *aboutToolbarButton = [UIButton buttonWithType:UIButtonTypeCustom];
[aboutToolbarButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[aboutToolbarButton setTitle:@"about" forState:UIControlStateNormal];
aboutToolbarButton.titleLabel.font = [UIFont fontWithName:@"Helvetica" size:12.0f];
[aboutToolbarButton.layer setCornerRadius:4.0f];
[aboutToolbarButton.layer setMasksToBounds:YES];
[aboutToolbarButton.layer setBorderWidth:1.0f];
[aboutToolbarButton.layer setBorderColor: [[UIColor grayColor] CGColor]];
aboutToolbarButton.frame = CGRectMake(0.0, 100.0, 60.0, 30.0);
[aboutToolbarButton addTarget:self action:@selector(getToUserSettingsViewController) forControlEvents:UIControlEventTouchUpInside];
self.toolbarButton = [[UIBarButtonItem alloc] initWithCustomView:aboutToolbarButton];
,我和按鈕文件的所有者連接,但它不能正常工作,請幫助我。
非常感謝!
謝謝......我是這樣一個白癡,但我改變它(0.0,0.0,60.0,30.0),它不'工作。 – jxdwinter