当POPOver视图导航栏上的Controller POPUP后退按钮位置发生变化时

时间:2014-08-28 05:17:19

标签: ios

当导航栏上的POPOverview控制器POPUP后退按钮位置发生变化时。

我想成为固定的位置。我怎样才能做到这一点?

-(void)viewDidLoad
{
  UIBarButtonItem *backBtn =[[UIBarButtonItem alloc]initWithTitle:@"" style:UIBarButtonItemStyleDone target:self action:@selector(popAlertAction:)];
        [backBtn setImage:[UIImage imageNamed:@"buttonBack"]];
        [backBtn setBackButtonTitlePositionAdjustment:UIOffsetMake(20, 20) forBarMetrics:UIBarMetricsDefault];
        self.navigationItem.leftBarButtonItem=backBtn;
}

//code that casuse problem

// text field event Handler

- (IBAction)EquipmentTypeDidBeginHandler:(UITextField *)sender {
    [self.textFieldLead resignFirstResponder];
    self.textField = @"EquipmentType";
    UIView *dummyView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)];
    self.textFieldEquipmentType.inputView = dummyView;
    self.customviewController = [[self storyboard] instantiateViewControllerWithIdentifier:@"PopOverTableViewController"];
    self.customviewController.dictionaryDataSource = [NSDictionary dictionaryWithDictionary:self.dictEquipment];
    // [NSDictionary dictionaryWithObjectsAndKeys:@"General",@"3",@"Gear",@"1",@"Pump",@"2",nil];
    self.customviewController.delegate = self;
    self.userDataPopover = [[UIPopoverController alloc] initWithContentViewController:self.customviewController];
    self.userDataPopover.delegate = self;
    self.userDataPopover.popoverContentSize = CGSizeMake(230.0, 110.0);
    [self.userDataPopover presentPopoverFromRect:CGRectMake(sender.frame.origin.x,sender.frame.origin.y-80,sender.frame.size.width,100)
                                          inView:self.view
                        permittedArrowDirections:UIPopoverArrowDirectionUp
                                        animated:YES];
}

0 个答案:

没有答案