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

iOS.UIKit.08.UIToolbar

时间:2014-06-04 14:55:30      阅读:350      评论:0      收藏:0      [点我收藏+]

标签:c   style   class   blog   code   java   

一、案例介绍:点击UIToolbar中的UIBarButtonItem,改变UILabel中的文本,如图01,02,03

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

二、案例步骤:

1、选择Simple View Aplication,取名cq.33.工具栏和导航栏,如图04

bubuko.com,布布扣

2、Maim.storyboard,如图05

bubuko.com,布布扣

3、CQ33ViewController.h

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

@interface CQ33ViewController : UIViewController

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

- (IBAction)save:(id)sender;

- (IBAction)open:(id)sender;

@end
bubuko.com,布布扣

4、CQ33ViewController.m

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

@interface CQ33ViewController ()

@end

@implementation CQ33ViewController

- (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)open:(id)sender
{
    self.label.text = @"点击Open";
}
- (IBAction)save:(id)sender
{
    self.label.text = @"点击Save";
}

@end
bubuko.com,布布扣

 

iOS.UIKit.08.UIToolbar,布布扣,bubuko.com

iOS.UIKit.08.UIToolbar

标签:c   style   class   blog   code   java   

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

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