UITextview的高度适应问题

NSString *text=@"this is the test"; CGSize constraintSize; constraintSize.width = rect1.size.width; constraintSize.height = MAXFLOAT; CGSize sizeFrame =[text sizeWithFont: [UIFont systemFontOfSize:16] constrainedToSize:constraintSize lineBreakMode: UILineBreakModeWordWrap]; textview.text=text; [textView setFrame:CGRectMake(0, 0, 310, sizeFrame.height+40)];

你可能感兴趣的:(UITextView)