iPad アプリ: 次のように、ナビゲーション バーにカスタマイズされたボタンをいくつか追加しました。
- (void)addEditButton{
UIButton *editButton = [UIButton buttonWithType:UIButtonTypeCustom];
editButton.frame = CGRectMake(0, 0, 50, 30);
[editButton setBackgroundImage:[[UIImage imageNamed:@"images_iPad.bundle/NavigationBar_Btn_iPad.png"] stretchableImageWithLeftCapWidth:15/2.0 topCapHeight:32/2.0] forState:UIControlStateNormal];
[editButton addTarget:self action:@selector(editAction:) forControlEvents:UIControlEventTouchUpInside];
[editButton setTitle:@"Edit" forState:UIControlStateNormal];
editButton.titleLabel.font = [UIFont fontWithName:kAPPBOLDFONT size:12];
editButton.titleLabel.shadowColor = [UIColor blackColor];
editButton.titleLabel.shadowOffset = CGSizeMake(0, -1);
UIBarButtonItem *editItem = [[[UIBarButtonItem alloc] initWithCustomView:editButton] autorelease];
self.navigationItem.rightBarButtonItem = editItem;
}
私の問題は次のとおりです。このボタンをクリックすると、popModelViewController:animate の後に別のビューコントローラーにプッシュされますが、このカスタマイズされたボタンが表示されませんが、これは機能します。ここだけでなく、他のものも同じです。助けてください自分。