iOS11向左移动的办法
if (isIOS11) {
UIView *leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 44, 44)];
leftView.extendRegionType = ClickExtendRegion;
UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(-15, 0, 30, 44)];
[btn setImage:[UIImage imageNamed:@"uikit_navigator_back_btn_normal"] forState:UIControlStateNormal];
[btn setImage:[UIImage imageNamed:@"uikit_navigator_back_btn_pressed"] forState:UIControlStateHighlighted];
[btn addTarget:self action:@selector(clickBackButton) forControlEvents:UIControlEventTouchUpInside];
[btn sizeToFit];
[leftView addSubview:btn];
_backButton = [[UIBarButtonItem alloc] initWithCustomView:leftView];
[self.navigationItem setLeftBarButtonItem:self.backButton];
}
网友评论