码迷,mamicode.com
首页 > 移动开发 > 详细

iOS.UIKit.09.UINavigationBar

时间:2014-06-04 14:47:56      阅读:298      评论:0      收藏:0      [点我收藏+]

标签:c   style   class   blog   code   java   

一、点击UINavigationBar中的UIBarButtonItem,改变UILabel中的文本,如图01,02,03

bubuko.com,布布扣图01bubuko.com,布布扣图02bubuko.com,布布扣图03

二、项目步骤:

1、选择Simple View Aplication,取名cq.40.UINavigationBar,如图04

bubuko.com,布布扣图04

2、Main.storyboard,如图05

bubuko.com,布布扣

3、CQ40ViewController.h

bubuko.com,布布扣
#import <UIKit/UIKit.h>

@interface CQ40ViewController : UIViewController

@property (weak,nonatomic) IBOutlet UILabel *label;

- (IBAction)save:(id)sender;
- (IBAction)add:(id)sender;

@end
bubuko.com,布布扣

4、CQ40ViewController.m

bubuko.com,布布扣
#import "CQ40ViewController.h"

@interface CQ40ViewController ()

@end

@implementation CQ40ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)save:(id)sender
{
    self.label.text = @"click Save";
}
- (IBAction)add:(id)sender
{
    self.label.text = @"click Add";
}

@end
bubuko.com,布布扣

 

iOS.UIKit.09.UINavigationBar,布布扣,bubuko.com

iOS.UIKit.09.UINavigationBar

标签:c   style   class   blog   code   java   

原文地址:http://www.cnblogs.com/cqchen/p/3764971.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!