1,
CGRect rect=[[UIScreenmainScreen] bounds];
NSLog(@"%@", NSStringFromCGRect(rect));
CGRect rect=[[UIScreenmainScreen] applicationFrame];
NSLog(@"%@", NSStringFromCGRect(rect));
从结构体转化为字符串NSStringFromCGRect:
上面几行代码分别打印出:
2012-07-03 09:39:34.848 UIWindowDemo[611:f803] {{0, 0}, {320, 480}}
2012-07-03 09:39:34.928 UIWindowDemo[611:f803] {{0, 20}, {320, 460}}
2,
UILabel的属性:
label.numberOfLines=0; //如果内容多于一行,就换行
label.lineBreakMode=UILineBreakModeWordWrap; //安单词换行
label.lineBreakMode = UILineBreakModeCharacterWrap; //按字符换行
3,
如何让UITextView边框显示圆角
因为UITextView的边框默认是方的,比较难看,可以用一下方法更改:
在UITextView下面放一个UITextField,设置UITextField的边框为圆角就ok
或者:
myTextView.layer.borderColor = [UIColorwhiteColor].CGColor;
myTextView.layer.borderWidth =1.0;
myTextView.layer.cornerRadius =5.0;
并且加入头文件 #import <QuartzCore/QuartzCore.h>
4,
怎么自动弹出软键盘: [控件 becomeFirstResponder]
浙公网安备 33010602011771号