在导航栏添加搜索框
来源:互联网 发布:turtlebot编程 编辑:程序博客网 时间:2024/06/08 00:47
//导航条的搜索条
UISearchBar *searchBar = [[UISearchBar alloc]initWithFrame:CGRectMake(500.0f,0.0f,250.0f,44.0f)];
searchBar.delegate = self;
[searchBar setPlaceholder:@
"搜索"
];
//将搜索条放在一个UIView上
UIView *searchView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 768, 44)];
searchView.backgroundColor = [UIColor clearColor];
[searchView addSubview:searchBar];
self.navigationItem.titleView = searchView;
// 自定义导航栏的背景:
[[UINavigationBar appearance] setBarTintColor:[UIColor redColor]];
//@{}代表Dictionary
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
0 0
- 在导航栏添加搜索框
- 在导航栏上添加搜索框的问题
- 用Swift在导航栏上“镶嵌”一个搜索框
- 用Swift在导航栏上“镶嵌”一个搜索框
- IOS 滑动tableview,导航栏渐渐显示,搜索框显示在导航栏上
- 在UIView上添加一个导航栏
- 在导航栏中添加UISegmentedControl
- 在导航栏上添加控件
- 在导航栏上添加按钮
- 搜索框和导航栏(React Native)
- 页面搜索框--在页面内实现导航
- 在navigationItem中添加搜索栏
- iOS 导航栏 搜索
- 在firefox的搜索栏中 添加百度搜索栏
- 在UINavigationController的导航栏中添加UISegmentedControl
- 在 iPhone 应用的导航栏添加自定义标题
- 在UINavigationController的导航栏中添加UISegmentedControl
- 在平板导航栏添加屏幕截图功能
- 13.4 javascript事件类型
- Java命名规范
- grunt-contrib-connect 中间件middleware属性
- Trying to dismiss the presentation controller while transitioning already
- 电脑使用问题解决Point
- 在导航栏添加搜索框
- FZU 2214 Knapsack problem (01背包)
- Java制作证书的工具keytool用法总结 (转载)
- 初识AOP
- 程序优化方法——CSAPP 读书笔记
- 买车注意事项
- Python代码优化及技巧笔记(一)
- mysql(一)
- C语言极简入门-VC6.0极速安装-2