在导航栏中添加UISegmentedControl
来源:互联网 发布:ubuntu grub 修复启动 编辑:程序博客网 时间:2024/06/05 03:22
在导航栏中添加UISegmentedControl ,实现的效果:
实现的代码:
UISegmentedControl *segmentedControl=[[UISegmentedControl alloc] initWithFrame:CGRectMake(80.0f, 8.0f, 200.0f, 30.0f) ];
[segmentedControl insertSegmentWithTitle:@"Food to eat" atIndex:0 animated:YES];
[segmentedControl insertSegmentWithTitle:@"Food to avoid" atIndex:1 animated:YES];
segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
segmentedControl.momentary = YES;
segmentedControl.multipleTouchEnabled=NO;
[segmentedControl addTarget:self action:@selector(Selectbutton:) forControlEvents:UIControlEventValueChanged];
UIBarButtonItem *segButton = [[UIBarButtonItem alloc] initWithCustomView:segmentedControl];
[segmentedControl release];http://wangjun.easymorse.com/?p=972
self.navigationItem.rightBarButtonItem = segButton;
[segButton release];
- 在导航栏中添加UISegmentedControl
- 在UINavigationController的导航栏中添加UISegmentedControl
- 在UINavigationController的导航栏中添加UISegmentedControl
- IOS在导航栏上居中显示分段控件(UISegmentedControl)
- IOS在导航栏上居中显示分段控件(UISegmentedControl)
- 在UIBarButtonItem上添加UISegmentedControl
- iOS 分度那控制UISegmentedControl添加到导航栏上的使用方法
- 在导航栏中添加音量加减button
- 在UIView上添加一个导航栏
- 在导航栏上添加控件
- 在导航栏添加搜索框
- 在导航栏上添加按钮
- 导航栏中添加多个UIBarButtonItem
- 如何利用JDownloads在首页导航栏中添加一个链接
- iOS 开发中在导航栏添加多个按钮并改变它的位置
- 在PDF文件(Adobe Reader)中添加书签导航
- iPhone开发在导航条中添加Info Light按钮
- 在标签控制器中添加导航器思路及其代码
- ASP.NET语法小结。
- vim单词纠正
- UISegmentedControl控件
- 总有一种力量,能够让你思绪万千
- 吸心大法
- 在导航栏中添加UISegmentedControl
- 在Tomcat和Eclipse进行远程调试的配置
- 2.23
- 卸载mac上老版本的xcode方法
- 关于拒绝服务攻击的一点初步思考
- 关于 java.util.concurrent 您不知道的 5 件事,第 1 部分
- 关于 java.util.concurrent 您不知道的 5 件事,第 2 部分
- libcurl教程
- Hibernate中openSession 和 getCurrentSession 的区别