2012年11月28日

计算NSString字符串的高度的代码

摘要: 以下代码,可以用来计算某个字符串在界面上显示时的高度,一般做界面自适应时会用到。NSString* str = @"test testImplement viewDidLoad to do additional setup after loading the view, typically from a nib";//可以精确计算字符串的换行,高宽等CGSize labelSize = [str... 阅读全文

posted @ 2012-11-28 17:09 流れ星ーー 阅读(162) 评论(0) 推荐(0) 编辑

创建圆形图片/控件的方法

摘要: 很多时候,我们为了效果好看,就要做出圆形的图片,或者是按钮,其实做法很简单。比如我想做一个程序中 希望用户的头像图形化来显示。我自定义了一个UIView@interface UserFaceIconView : UIView{ UIImage * _faceImage;}在初始化的代码中- (id)initWithFrame:(CGRect)frame{self = [super initWith... 阅读全文

posted @ 2012-11-28 14:05 流れ星ーー 阅读(153) 评论(0) 推荐(0) 编辑

导航