Subramani Subramani - 5 months ago 38
iOS Question

How to increase label or text view size (height and width) in tableview by objective c(For Conversation Page) Can you Help me?

I can't Increase Label or Textview Size in table view by objective c.

I'm Struck for this problem.

Answer

If you use textview

-(void)textView
    {
        CGFloat fixedWidth = textView.frame.size.width;
        CGSize newSize = [textView sizeThatFits:CGSizeMake(fixedWidth, MAXFLOAT)];
        CGRect newFrame = textView.frame;
        newFrame.size = CGSizeMake(fmaxf(newSize.width, fixedWidth), newSize.height);
        NSLog(@"this is updating height%@",NSStringFromCGSize(newFrame.size));

               height=newFrame.size.height;


    }

Get the height from this method then set it to heightforrow method

Set constraints for the textview leading,trailing,top,bottom.

Comments