Skip to content

vast0608/navigationItemSpace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

navigationItemSpace

不多说,直接上图

效果图

代码也很简单

UIButton *settingButton = [UIButton buttonWithType:UIButtonTypeCustom];
    
//修改按钮向右偏移30 point
[settingButton setFrame:CGRectMake(20.0, 0.0, 44.0, 44.0)];
[settingButton setTitle:@"测试" forState:0];
[settingButton  setTitleColor:[UIColor blueColor] forState:0];
//修改方法
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 44.0, 44.0)];
view.backgroundColor = [UIColor redColor];
[view addSubview:settingButton];
    
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:view];
self.navigationItem.rightBarButtonItem = rightItem;

About

导航栏按钮位置偏移

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published