标签:
UIButton
//初始化 位置 UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width-180, 45, 80, 30)]; [btn.layer setCornerRadius:5.0]; //设置矩形四个圆角半径 [btn.layer setBorderWidth:1.0]; //边框宽度 CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGColorRef colorref = CGColorCreate(colorSpace,(CGFloat[]){ 0.9, 0.9, 0.9, 1 }); [btn.layer setBorderColor:colorref];//边框颜色 [btn setTitle: @"Button" forState: UIControlStateNormal]; btn.titleLabel.font = [UIFont systemFontOfSize: 14.0]; [btn setBackgroundColor: [UIColor blueColor]]; [btn setTitleColor:[UIColor blackColor]forState:UIControlStateNormal]; [btn addTarget:self action:@selector(btnActioin:) forControlEvents:UIControlEventTouchUpInside]; btn.tag = 1; [btn setImage:[UIImage imageNamed:@"trade_choose_default"] forState:UIControlStateNormal];
UIColor
[UIColor colorWithRed:0.95 green:0.93 blue:0.92 alpha:1];
UILabel
label.text=@"Label"; label.hidden=YES;
UIImage
[UIImage imageNamed:@"trade_choose_default"]
UIView
//设置动画 CGContextRef context = UIGraphicsGetCurrentContext(); [UIView beginAnimations:nil context:context]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:0.6];//动画时间长度,单位秒,浮点数 //改变视图位置 [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1]; self.addressPicker.frame = CGRectMake(0, 380, 320, 180); //绑定视图事件 [UIView setAnimationDelegate:self]; // 动画完毕后调用 animationFinished [UIView setAnimationDidStopSelector:@selector(animationFinished)]; //开始执行动画 [UIView commitAnimations]; //将视图置前 [self.view bringSubviewToFront:logisticsPicker]; -(void)animationFinished{ NSLog(@"动画结束!"); }
UITextField
[textField setBorderStyle:UITextBorderStyleRoundedRect]; //外框类型 textField.placeholder = @"password"; //默认显示的字 textField.secureTextEntry = YES; //密码
标签:
原文地址:http://my.oschina.net/jack088/blog/512229