toolbar

作者: 百思不得解 | 来源:发表于2016-04-22 21:13 被阅读0次

toolbar

-(UIToolbar *)toolbar{

if (!_toolbar) {

_toolbar = [[UIToolbar alloc]init];

UIBarButtonItem *btn1=[[UIBarButtonItem alloc]initWithTitle:@"Park" style:UIBarButtonItemStylePlain target:self action:@selector(doPark)];

UIBarButtonItem *btn2=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:self action:nil];

UIBarButtonItem *btn3=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:self action:nil];

UIBarButtonItem *freeBtn=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];

NSArray *arr1=[[NSArray alloc]initWithObjects:freeBtn,btn1,freeBtn,btn2,freeBtn,btn3,freeBtn,nil];

[_toolbar setItems:arr1];

[self.view addSubview:_toolbar];

}

return _toolbar;}

这个样式UIBarButtonSystemItemFlexibleSpace可以让button均匀的分布在toobar上面

http://blog.csdn.net/totogo2010/article/details/7682641

http://www.tuicool.com/articles/ZVjie2

相关文章

网友评论

      本文标题:toolbar

      本文链接:https://www.haomeiwen.com/subject/oxuxrttx.html