动态网页的制作基础
2011-03-21 12:21
274 查看
@implementation BViewController
@synthesize mswitch;
@synthesize mbt;
@synthesize lb;
@synthesize xbt;
-(IBAction) myAction:(id)sender{
//mbt.titleLabel.text = @"AAA";
UIView *v = (UIView*)sender;
if (v.tag == 1000) {
UIButton *bt = (UIButton*) sender;
[bt setTitle:@"中国" forState:FALSE]; //forestate 值为true或为false
NSLog(@"tag =1000");
NSLog(@"bt titleis:%@",bt.titleLabel.text);
}else if (v.tag == 2000) {
UISwitch *st = (UISwitch*)sender;
if ([st isOn]) {
NSLog(@"st is on");
}else{
NSLog(@"st is off");
}
}
lb.text = @"LBBBB";
//mtag = lb.tag;
}
/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
*/
// Implement loadView to create a view hierarchy programmatically, without using a nib.
//- (void)loadView {
//
//
//
//}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[xbt addTarget:self action:@selector(myAction:) forControlEvents:UIControlEventTouchDown];
[super viewDidLoad];
}
@synthesize mswitch;
@synthesize mbt;
@synthesize lb;
@synthesize xbt;
-(IBAction) myAction:(id)sender{
//mbt.titleLabel.text = @"AAA";
UIView *v = (UIView*)sender;
if (v.tag == 1000) {
UIButton *bt = (UIButton*) sender;
[bt setTitle:@"中国" forState:FALSE]; //forestate 值为true或为false
NSLog(@"tag =1000");
NSLog(@"bt titleis:%@",bt.titleLabel.text);
}else if (v.tag == 2000) {
UISwitch *st = (UISwitch*)sender;
if ([st isOn]) {
NSLog(@"st is on");
}else{
NSLog(@"st is off");
}
}
lb.text = @"LBBBB";
//mtag = lb.tag;
}
/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
*/
// Implement loadView to create a view hierarchy programmatically, without using a nib.
//- (void)loadView {
//
//
//
//}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[xbt addTarget:self action:@selector(myAction:) forControlEvents:UIControlEventTouchDown];
[super viewDidLoad];
}
相关文章推荐
- 基础动画-动态遮罩教程-Flash-网页制作
- 基础动画-动态遮罩教程-Flash-网页制作
- 网页制作基础t
- 9、网页制作Dreamweaver(jQuery基础:事件)
- 动态网页基础
- asp.net动态网页制作视频教程
- 网页制作基础教程(网址)
- 由浅入深学习动态网页制作PHP的编程与应用(一)
- 动态网页开发基础
- cocos2d制作动态光晕效果基础——blendFunc
- 【推荐】8款神奇的动态网页布局及其制作方法
- 网页制作之html基础学习1-简介
- 网页制作中常用的基础知识002-CSS布局与表格布局的区别
- HTML网页制作基础
- HTML网页制作基础第二弹
- jsp--动态网页开发基础
- 网页制作基础知识整理1(课堂笔记)
- 前端网页制作以HTML基础来学习DIV…
- 动态网页开发基础
- HTML网页制作基础