首页 > 移动平台 > 详细

iOS.UIKit.09.UINavigationBar

时间:2014-06-04 14:46:51      阅读:473      评论:0      收藏:0      [点我收藏+]

一、点击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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!