iOS开发之UISearchBar(自用贴)
来源:互联网 发布:天龙八部手游转职优化 编辑:程序博客网 时间:2024/06/10 00:17
//声明:本贴为自用贴,介于本人使用习惯可能不大家的使用习惯不同,不喜勿喷。、
简单图片生成:生成图片代码
UISearchBar*searchBar = [[UISearchBaralloc]initWithFrame:CGRectMake(0,0, 100,20)];
[self.viewaddSubview:searchBar];
UIImage* image =[UIImageimageNamed:@"1"] ;
//设置背景图片
[searchBar setBackgroundImage:image];
//设置背景色
[searchBar setBackgroundColor:[UIColorclearColor]];
//设置文本框背景
[searchBar setSearchFieldBackgroundImage:imageforState:UIControlStateNormal];
//设置字体颜色、默认字体颜色
UITextField *searchField = [searchBarvalueForKey:@"_searchField"];
searchField.textColor = [UIColorwhiteColor];
[searchField setValue:[UIColorwhiteColor] forKeyPath:@"_placeholderLabel.textColor"];
//设置放大镜图片样式
UIImage * magnifieImage = [UIImageimageNamed:@"2"];
UIImageView *magnifieImageView = [[UIImageViewalloc] initWithImage:magnifieImage];
magnifieImageView.frame =CGRectMake(0,0, 20 ,20);
searchField.leftView = magnifieImageView;
- iOS开发之UISearchBar(自用贴)
- iOS开发之tableView(自用贴)
- iOS开发之label(自用贴)
- iOS开发之UIButton(自用贴)
- iOS开发之textfield(自用帖)
- IOS开发之UISearchBar应用
- IOS开发之UISearchBar应用
- IOS开发之UISearchBar应用
- IOS开发之UISearchBar应用
- IOS开发之UISearchBar应用
- IOS开发之UISearchBar应用
- IOS开发之UISearchBar应用
- IOS开发之UISearchBar应用
- iOS开发之UISearchBar初探
- IOS开发之UISearchBar应用
- 【iOS】iOS开发之UISearchBar应用
- IOS开发之UISearchBar自定义外观
- IOS开发之UISearchBar自定义外观
- Splay Tree的C++实现
- 设计模式之状态模式
- jquery动画累积执行解决方法
- 在Vim中使用ctags
- spring的IOC和AOP详细讲解
- iOS开发之UISearchBar(自用贴)
- wparam,lparam在WIN32 API编程中的具体意义
- Android View事件机制 21问21答
- 【LeetCode】61. Rotate List解法及分析
- 19.简报配置(Newsletter Configuration)
- bzoj3191【JLOI2013】卡牌游戏
- 类加载器详解
- bzoj3192【JLOI2013】删除物品
- spark分组排序