//1.创建toolbar左边的按钮,调用initWithTitle方法进行初始化
UIBarButtonItem *extend = [[UIBarButtonItemalloc]initWithTitle:@"扩展"style:UIBarButtonItemStylePlain
target:self action:nil];
//2.创建toolbar中间的flexibleSpace(弹性空白),调用initWithBarButtonSystemItem方法进行初始化
UIBarButtonItem *flexibleSpace =
[[UIBarButtonItemalloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
代码创建FlexibleSpaceBarButton(弹性空白),码迷,mamicode.com
时间: 2024-10-25 02:17:21