1. 設定UITextView圓角問題做法是在#import QuartzCore/QuartzCore.h 後,便能呼叫[textView.layer setCornerRadius:10]; 來把UITextView 設定圓角2. UITextView根據文字大小自適應高度透過實現文字字數來確定高度,如下:NSString * desc = @"Description it is a test font, and don"t become angry for which i use to do here.Now here is a very nice party from american or not!"; CGSize size = [desc sizeWithFont:[UIFont systemFontOfSize:14] constrainedToSize:CGSizeMake(240, 2000) lineBreakMode:UILineBreakModeWordWrap]; 只有UILabel需要定義的numberoflines為0,即不做行數的限制。如下:[label setNumberOfLines:0]; [label setFrame:CGRectMake(40, 135, 240, size.height+10)]; [label setText:desc];
1. 設定UITextView圓角問題做法是在#import QuartzCore/QuartzCore.h 後,便能呼叫[textView.layer setCornerRadius:10]; 來把UITextView 設定圓角2. UITextView根據文字大小自適應高度透過實現文字字數來確定高度,如下:NSString * desc = @"Description it is a test font, and don"t become angry for which i use to do here.Now here is a very nice party from american or not!"; CGSize size = [desc sizeWithFont:[UIFont systemFontOfSize:14] constrainedToSize:CGSizeMake(240, 2000) lineBreakMode:UILineBreakModeWordWrap]; 只有UILabel需要定義的numberoflines為0,即不做行數的限制。如下:[label setNumberOfLines:0]; [label setFrame:CGRectMake(40, 135, 240, size.height+10)]; [label setText:desc];