UIViewController *mine = [self.navigationController.viewControllers objectAtIndex:0];
UIImage *nextImg = [UIImage imageNamed:@"NextIcon.png"];
UIButton *nextBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[nextBtn setBackgroundImage:nextImg forState:UIControlStateNormal];
nextBtn.frame = CGRectMake(0, 0, nextImg.size.width, nextImg.size.height);
[nextBtn addTarget:self action:@selector(nextAction:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *next = [[[UIBarButtonItem alloc] initWithCustomView:nextBtn]autorelease];
mine.navigationItem.rightBarButtonItem = next;
沒有留言:
張貼留言