0

I need to create an UITextView like in Image, but UITextView auto resize to content height. It is in chat message. At left-bottom and right-bottom have one arrow. But I don't know how to draw or create them in iOS. Can someone tell me how to do this? thank you very much.

Arrow in left-bottom and turn the left if messsage from another body, arrow on the right-bottom and turn the right when message from "self"

enter image description here

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Lantranduc
  • 29
  • 7

1 Answers1

1

You can use the mirror effect On the image. by using same image for both sender and receiver

-(UIImage*)setBubbleImageForSender
{
    UIImage *image = [UIImage imageNamed:@"sender.png"];

    return image;
}

-(UIImage*)setBubbleImageForReceiver
{
    UIImage *image = [UIImage imageNamed:@"sender.png"];

    image = [UIImage imageWithCGImage:image.CGImage
                                scale:image.scale
                          orientation:UIImageOrientationUpMirrored];
    return image;
}

The above thing will change the arrow direction for the chat app.

for resizing the height and width you can use the [imgvw resizableImageWithCapInsets:..] for the imageview and set table cell height accordingly.

Thanks

Esha
  • 1,328
  • 13
  • 34