摘要:
//测量字符串长度, 两个参数都可以固定或者不固定 CGSize size = [text sizeWithFont:font constrainedToSize:CGSizeMake(150.0f, MAXFLOAT) lineBreakMode:UILineBreakModeWordWrap];2.换行方式UILineBreakModeWordWrap=0,以单词为单位换行,以单位为单位截断。UILineBreakModeCharacterWrap,以字符为单位换行,以字符为单位截断。UILineBreakModeClip,以单词为单位换行。以字符为单位截断。UILineBreakMo.. 阅读全文
摘要:
1.获取系统得时间与日期NSString* date;NSDateFormatter* formatter = [[NSDateFormatteralloc]init]; [formattersetDateFormat:@"YYYY-MM-dd%20hh:mm:ss"]; date = [formatterstringFromDate:[NSDatedate]];2.分开获得/获得系统时间NSDate*senddate=[NSDatedate];NSDateFormatter*dateformatter=[[NSDateFormatteralloc]init];[datef 阅读全文
摘要:
//button的长按事件 UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizeralloc] initWithTarget:selfaction:@selector(btnLong:)]; //长按时间 longPress.minimumPressDuration = 0.8; [button addGestureRecognizer:longPress];#pragma mark -#pragma mark Table Delegate Methods- (NSInteger)tableVie... 阅读全文
摘要:
1.//用画图的方式设置圆角mImageView.image=[UIImage imageNamed:@"bg1.png"]; mImageView.frame=CGRectMake(center.x-radius, center.y-radius, 2*radius, 2*radius); mImageView.layer.cornerRadius=radius;//设置圆角半径 mImageView.layer.masksToBounds=YES; [mImageView.layer setBorderWidth:1];//设置边框宽度 [mImageView.laye 阅读全文
摘要:
//设置边框样式,只有设置了才会显示边框样式 text.borderStyle = UITextBorderStyleRoundedRect; typedef enum { UITextBorderStyleNone, UITextBorderStyleLine, UITextBorderStyleBezel, UITextBorderStyleRoundedRect } UITextBorderStyle;//设置输入框的背景颜色,此时设置为白色如果使用了自定义的背景图片边框会被忽略掉 text.backgroundColor = [UIColor whiteColor];//设... 阅读全文