标签:uibarbuttonitem ios swift 留空
IOS:
UIBarButtonItem * searchBtnItem = [[UIBarButtonItem alloc]initWithCustomView:_searchButton]; UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; /** * width为负数时,相当于btn向右移动width数值个像素,由于按钮本身和边界间距为5pix,所以width设为-5时,间距正好调整 * 为0;width为正数时,正好相反,相当于往左移动width数值个像素 */ negativeSpacer.width = -16; self.navigationItem.rightBarButtonItems= [NSArray arrayWithObjects:negativeSpacer,searchBtnItem, nil];
SWIFT:
标签:uibarbuttonitem ios swift 留空
原文地址:http://blog.csdn.net/yangzhen19900701/article/details/41114231