JKSearchBar 0.0.2

JKSearchBar 0.0.2

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布时间最后发布2016 年 5 月

jidibingren 维护。



  • 作者
  • fanhuibo

JKSearchBar,自定义易于使用的搜索栏,类似于 UISearchBar,使用 UIView 和 UITextField

演示

使用方法

通过代码

 JKSearchBar *searchBarCode = [[JKSearchBar alloc]initWithFrame:CGRectMake(0, 50, 320, 44)];
searchBarCode.inputView = picker;
searchBarCode.placeholder = @"this is a placeholder";
searchBarCode.placeholderColor = [UIColor purpleColor];

searchBarCode.backgroundColor = [UIColor yellowColor];
//searchBarCode.inputAccessoryView =view;
//searchBarCode.inputView = picker;
[searchBarCode.cancelButton setTitle:@"取消" forState:UIControlStateNormal];
[self.view addSubview:searchBarCode];

通过 XIB

拖动一个 UIView,并在 IB 面板中将自定义类修改为 JKSearchBar

@property (weak, nonatomic) IBOutlet JKSearchBar *searchBar;
self.searchBar.placeholder = @"please input a word";
self.searchBar.textColor = [UIColor blackColor];
self.searchBar.delegate = self;
self.searchBar.iconImage = [UIImage imageNamed:@"JKSearchBar_ICON"];
//self.searchBar.textBorderStyle = UITextBorderStyleNone;
//self.searchBar.keyboardType = UIKeyboardTypeDecimalPad;
//elf.searchBar.placeholderColor = [UIColor redColor];

许可证

JKSearchBar 适用于 MIT 许可证。