摘要: UIImageView * imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"oiuyfdsa.png"]]; imageView.frame = CGRectMake(20.f, 20.f, 100.f, 100.f); imageView.layer.masksToBounds = YES; imageView.layer.cornerRadius = 50;注意:1、该方法需要导入QuartzCore框架#import 2、cornerRadius的值为图片尺寸的一半再注意:... 阅读全文
posted @ 2013-04-03 15:58 Dadada胖纸er 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 用xib生成的UITextField文字默认是水平左对齐,垂直居中对齐的,但是用代码生成的UITextField确是默认是水平左对齐,垂直顶对齐。到UITextField的头文件看了一下,发现只有设置水平对齐的属性,却没有垂直对齐属性。因为xib里都可以设垂直对齐属性,所以应有的,于是再到其父类中找,终于在UIControl.h中找到了,下面两个属性就是分别控制水平与垂直方向对齐的。@property(nonatomic) UIControlContentVerticalAlignment contentVerticalAlignment; // how to position con... 阅读全文
posted @ 2013-04-03 10:45 Dadada胖纸er 阅读(140) 评论(0) 推荐(0) 编辑