iOS设置导航栏左按钮的位置
作者:
渐行渐远min | 来源:发表于
2017-01-17 14:18 被阅读0次UIButton*leftbutton = [selfset_leftButton];
[leftbuttonaddTarget:selfaction:@selector(left_click:)forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem*item = [[UIBarButtonItemalloc]initWithCustomView:leftbutton];
UIBarButtonItem* spaceItem = [[UIBarButtonItemalloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpacetarget:nilaction:nil];
//将宽度设为负值
spaceItem.width= -20;
//将两个BarButtonItem都返回给NavigationItem
self.navigationItem.leftBarButtonItems=@[spaceItem ,item];
本文标题:iOS设置导航栏左按钮的位置
本文链接:https://www.haomeiwen.com/subject/gpmmbttx.html
网友评论