摘要: 1 UIView *view = [[UIView alloc] init];2 view.hidden = YES; // 隐藏3 [view setBackgroundColor:[UIColor colorWithRed:1.0 green:0.5 blue:0.5 alpha:1.0]]; // 设置背景颜色,此处的alpha只是让背景透明4 view.alpha = 0.6; // 设置透明效果,背景和文字都透明5 view.contentMode = UIViewContentModeBottom; // 设置与父视图位置关系6 view.c... 阅读全文
posted @ 2013-02-04 16:24 diablo大王 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 1 UISegmentedControl *seg = [[UISegmentedControl alloc] 2 initWithItems:[NSArray arrayWithObjects:@"one",@"two",@"three", nil]]; 3 seg.segmentedControlStyle = UISegmentedControlStylePlain; // 设置分段按钮类型 4 seg.segmentedControlStyle = UISegmentedControlStyleBar; 5... 阅读全文
posted @ 2013-02-04 15:37 diablo大王 阅读(457) 评论(0) 推荐(0) 编辑
摘要: 1 UISwitch *sw = [[UISwitch alloc] initWithFrame:CGRectMake(0, 0, 100, 50)];2 sw.on = YES; // 开启3 [sw addTarget:self4 action:@selector(mySwitch:)5 forControlEvents:UIControlEventValueChanged]; // 值改变时触发此事件 阅读全文
posted @ 2013-02-04 15:11 diablo大王 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 1 UITextField *tf = [[UITextField alloc] initWithFrame:CGRectMake(20, 20, 280, 30)]; 2 tf.borderStyle = UITextBorderStyleNone; // 无边框线 3 // UITextBorderStyleBezel(边框+阴影) ,UITextBorderStyleLine(边框线) ,UITextBorderStyleRoundedRect(圆角+阴影) 按钮样式 4 tf.text = @"xxxxx"; // 内容 5 ... 阅读全文
posted @ 2013-02-04 15:05 diablo大王 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 1 UIButton *bt = [UIButton buttonWithType:UIButtonTypeContactAdd];// UIButtonTypeCustom, UIButtonTypeRoundedRect; // 2 [bt setTitle:@"myButton" forState:UIControlStateNormal]; // 普通状态 3 [bt setTitle:@"Button1" forState:UIControlStateHighlighted]; // 触摸时 4 [bt setTitle:@"disB 阅读全文
posted @ 2013-02-04 14:46 diablo大王 阅读(2193) 评论(0) 推荐(0) 编辑
摘要: UILabel *label = [[UILabel alloc] init]; label.frame = self.view.bounds; // 设置大小 label.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth | UIViewAnimationTransitionNone | UIViewAutoresizingFlexibleHeight | UIViewAnimationTransitionFlipFromLe... 阅读全文
posted @ 2013-02-04 13:48 diablo大王 阅读(244) 评论(0) 推荐(0) 编辑