在UINavigationController的导航栏中添加UISegmentedControl
来源:互联网 发布:大数据 股票预测模型 编辑:程序博客网 时间:2024/05/24 15:42
在导航栏中添加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];
self.navigationItem.rightBarButtonItem = segButton;
[segButton release];
- 在UINavigationController的导航栏中添加UISegmentedControl
- 在UINavigationController的导航栏中添加UISegmentedControl
- 在导航栏中添加UISegmentedControl
- UINavigationController导航栏中添加多个UIBarButtonItem
- iOS 分度那控制UISegmentedControl添加到导航栏上的使用方法
- iOS中导航控制器的使用 UINavigationController
- IOS在导航栏上居中显示分段控件(UISegmentedControl)
- IOS在导航栏上居中显示分段控件(UISegmentedControl)
- UINavigationController导航栏的隐藏和显示
- 在UIBarButtonItem上添加UISegmentedControl
- 视图导航栏UInavigationController
- UI-UINavigationController导航栏
- 导航栏控制器--UINavigationController
- iOS 导航条上添加UISegmentedControl,点击分类按钮,显示不同的ViewController
- 在导航栏中添加音量加减button
- iOS 开发中在导航栏添加多个按钮并改变它的位置
- 自定义UINavigationController导航栏背景
- UINavigationController设置导航栏属性
- winlogon.exe错误:小心设置搜狗拼音输入法
- voip知识手册
- iPhone 应用中直接连接到特定的app store应用页面
- c#操作XML文件的方法
- (转)如何解决VC6.0中win32 error267错误
- 在UINavigationController的导航栏中添加UISegmentedControl
- 三层架构的项目中通常异常的处理方式!!!
- iphone通过UIActionSheetDelegate实现警告
- JS中的信息提示框
- 在MkMapView中添加自己当前位置的大头针
- 【转贴】一个10年程序员职业发展、总结和困境
- 利用MKMapView显示自己当前位置的地图
- 清除(设置)eclipse的workspace记录
- ios利用MKMapView实现简单的地图