obj-c 自学随笔--- 加载UIBarButtonItem 到UINavigationController
来源:互联网 发布:单片机crc校验程序 编辑:程序博客网 时间:2024/05/29 06:34
- (void)viewDidLoad
{
[superviewDidLoad];
//设置导航右边 按钮
self.navigationItem.rightBarButtonItem=[[UIBarButtonItemalloc] initWithTitle:@"添加"style:UIBarButtonItemStyleBorderedtarget:selfaction:@selector(perfromAdd:)];//点击按钮触发 perfromAdd方法
//使用 UIBarButtonItem的initWithCustomView 方法把UISwitch放入到导航栏中
UISwitch* uSwitch=[[UISwitchalloc] init];
UIBarButtonItem *buttonItem=[[UIBarButtonItemalloc] initWithCustomView:uSwitch];
NSArray *array=[[NSArrayalloc] initWithObjects:[[UIBarButtonItemalloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAddtarget:selfaction:@selector(perfromAdd:)], buttonItem,nil];
//使用 leftBarButtonItems方法 设置多个按钮
self.navigationItem.leftBarButtonItems=array;
}
//点击按钮事件
-(void)perfromAdd:(id) paramSender
{
UIAlertView* alterView=[[UIAlertViewalloc] initWithTitle:@"提示"message:@"添加成功" delegate:nilcancelButtonTitle:@"确定"otherButtonTitles:@"取消",nil];
[alterViewshow];
}
- obj-c 自学随笔--- 加载UIBarButtonItem 到UINavigationController
- obj-c 自学随手笔记----- UINavigationController
- obj-c 自学随笔 UITableView 案例
- UIToolbar UINavigationController UINavigationBar UIBarButtonItem
- UIToolbar UINavigationController UINavigationBar UIBarButtonItem
- UIToolbar UINavigationController UINavigationBar UIBarButtonItem
- UINavigationController和UIBarButtonItem
- UINavigationController-UIBarButtonItem(翻页)
- obj-c 自学随手笔记------ UISegmentedControl
- UINavigationController详解(二)UINavigationBar(UIBarButtonItem)
- UINavigationController详解(二)UINavigationBar(UIBarButtonItem)
- UINavigationController详解与使用:添加UIBarButtonItem
- UINavigationController详解与使用(一)添加UIBarButtonItem
- 自定义的UINavigationController 设置UIBarButtonItem主题
- UINavigationController使用之手动添加UIBarButtonItem
- UINavigationController导航栏中添加多个UIBarButtonItem
- iOS学习之UINavigationController详解与使用(一)添加UIBarButtonItem
- IOS学习之UINavigationController详解与使用(一)添加UIBarButtonItem
- Java中的流、字符流和字节流
- java中常用的几个基础概念
- 在用 strtok函数的时候,在linux编译的问题
- Struts的图片的上传(只为未来自己用到的时候可以借鉴)。
- 【MFC】修改过的Excel处理类
- obj-c 自学随笔--- 加载UIBarButtonItem 到UINavigationController
- 如何查看和停止Linux启动的服务
- C++ Socket编程步骤
- GCD(一)
- java 的nio与io对比
- 简单内存泄漏检测方法,解决Detected memory leaks!问题 .
- ios开发之改变UIWebView文本字体的样式和大小
- shell算数运算
- N!