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中不是非常精确

posted @ 2014-08-01 11:13  给me一首歌的时间  阅读(189)  评论(0编辑  收藏  举报