左上角和右上角的按钮
来源:互联网 发布:网络上弹棉花什么意思 编辑:程序博客网 时间:2024/05/03 14:53
@implementation DiErYeViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
//建立buttonUIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];button.frame = CGRectMake(0, 0, 40, 40);[self.view addSubview:button];[button setImage:[UIImage imageNamed:@"tb1"] forState:UIControlStateNormal];[button addTarget:self action:@selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];// 实现左上角按钮self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];// 实现右上角按钮self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
// 文字显示
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@”关闭” style:UIBarButtonItemStylePlain target:self action:@selector(clickButton:)];
}
// 实现点击的方法
- (void)clickButton:(UIButton *)button{
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
- 左上角和右上角的按钮
- 页面左上角,右上角添加按钮。
- 将ubuntu左上角的关闭按钮设置到右上角
- 如何将Ubuntu 10.04 LTS 的窗口控制按钮从左上角调整到右上角
- 如何将Ubuntu 10.04 LTS 的窗口控制按钮从左上角调整到右上角
- Ubuntu 10.04 LTS 的窗口控制按钮从左上角调整到右上角
- 给UIView左上角和右上角添加圆弧
- 设置右上角的菜单按钮
- 设置按钮右上角的badge
- 3左上角右上角动态规划
- 如何自定义左上角的返回按钮
- ToolBar左上角一个返回按钮的实现
- mac osx应用程序的一些简单设置(隐藏左上角缩小和全屏的按钮)
- 自定义ImageView 实现左上角和右上角是圆形,左下角和右下角为直角
- 使窗体右上角的X按钮失效
- 右上角关闭按钮的事件编辑
- MFC__Dialog去掉右上角的关闭按钮
- EAS BOS隐藏分录右上角的按钮
- C++ 定时发送文件到服务器
- HBase基础知识(2):CRUD操作之get方法
- 択捉島訪問―ロシアの無益な挑発
- 奇数幻方构造法
- OpenCV 1.0 颜色直方图操作(建立,获取bin,给bin赋值)
- 左上角和右上角的按钮
- Winform(C#)Flash控件 属性 方法 事件
- php 对象复制(克隆)clone()
- 机房收费系统之上下机
- 如何对使用了autolayout的UIView添加动画
- lua中函数为什么有时候可以省略”()”?
- SAP系统核心模块都有哪些?
- caffe infogain_loss 信息熵代价函数
- JDK配置环境变量