iPad开发:导航栏上的自定义按钮在推后无法看到 - &; pop

时间:2012-07-06 07:42:48

标签: ipad button customization

iPad应用:我已经为navigationBar添加了一些自定义按钮,如下所示:

- (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;   

}

我的问题是:我点击了这个按钮,它将推送到另一个viewController,在popModelViewController:animate之后,我看不到这个自定义按钮,虽然这样,它确实有效。而不仅仅是这里,其他都是一样的,请帮我。

0 个答案:

没有答案