UIToolbar *bar = [[UIToolbar alloc]init];
[self.view addSubview:bar];
[bar setBackgroundImage:[UIImage new] forToolbarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
bar.clipsToBounds = YES;
// [bar setShadowImage:[UIImage new] forToolbarPosition:UIBarPositionAny];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithImage:[[UIImage imageNamed:@"arrows_white"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(backClick)];
//可伸缩
UIBarButtonItem* flexItem=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
bar.items = @[backItem,flexItem];
网友评论