//第一个按钮
UIButton *but = [UIButton buttonWithType:UIButtonTypeCustom];
[butaddTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
[butsetImage:[UIImage imageNamed:@"btn_pause"] forState:UIControlStateNormal];
[butsizeToFit];
UIBarButtonItem *Item = [[UIBarButtonItem alloc] initWithCustomView:but];
// UIBarButtonItem *fixedSpaceBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
// fixedSpaceBarButtonItem.width = 22;
//第二个
UIButton *but1 = [UIButton buttonWithType:UIButtonTypeCustom];
[but1addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
[but1setImage:[UIImage imageNamed:@"btn_play"] forState:UIControlStateNormal];
[but1sizeToFit];
UIBarButtonItem *Item1 = [[UIBarButtonItem alloc] initWithCustomView:but1];
// UIBarButtonItem *fixed = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
// fixed.width = 22;
//第三个
UIButton *set2 = [UIButton buttonWithType:UIButtonTypeCustom];
[set2addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
[set2setImage:[UIImage imageNamed:@"btn_play"] forState:UIControlStateNormal];
[set2sizeToFit];
UIBarButtonItem *item2 = [[UIBarButtonItem alloc] initWithCustomView:set2];
self.navigationItem.rightBarButtonItems =@[Item,Item1,item2];
网友评论