要运行示例项目,请先克隆仓库,然后从Example目录运行pod install
RZToolbar可以通过CocoaPods获取。要安装它,只需在Podfile中添加以下行
pod "RZToolbar"
_toolbar = [[RZToolbar alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height - BAR_HEIGHT, self.view.bounds.size.width, BAR_HEIGHT)];
NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:14], NSForegroundColorAttributeName: [UIColor blueColor]};
NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:@"Foo" attributes:attributes];
RZBarButtonItem *fooBarItem = [[RZBarButtonItem alloc] initWithAttributedTitle:attrString target:nil action:nil];
RZBarButtonItem *spaceBarItem = [[RZBarButtonItem alloc] initWithSpaceFlexible:YES];
[_toolbar setItems:@[fooBarItem, spaceBarItem]];
RookieZn,[email protected]
RZToolbar在MIT许可证下可用。更多信息请参阅LICENSE文件。