首页 > 代码库 > iOS textFiledView,label自适应高度

iOS textFiledView,label自适应高度

 CGSize constraintSize;

    constraintSize.width = 320;

    constraintSize.height = MAXFLOAT;

    CGSize sizeFrame =[infoTextView.text sizeWithFont:infoTextView.font = [UIFont systemFontOfSize:12.0] constrainedToSize:constraintSize lineBreakMode:NSLineBreakByWordWrapping];

    infoTextView.frame = CGRectMake(10,titleLabel.frame.origin.y+titleLabel.frame.size.height,sizeFrame.width,sizeFrame.height+5);

 

 注:这个方法在  textFiledView中不是非常精确