首页 > 移动平台 > 详细

iOS.UIKit.08.UIToolbar

时间:2014-06-04 14:54:25      阅读:469      评论:0      收藏:0      [点我收藏+]

一、案例介绍:点击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

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

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