您的位置:首页 > 其它

动态网页的制作基础

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];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: