I am creating a chat application. I have to stretch the bubble
image to fit the text, like other chatapps
. I use AutoLayout restrictions. The image size containing the bubble booster is excellent. (I gave the background color to yello). The bubble image does not stretch.
I have added these restrictions:
To stretch the image, I added the following:
let myImage = self.imageNamed("Bubble_Me") let new_Image = myImage.stretchableImage(withLeftCapWidth: 15, topCapHeight: 14) cell.bubbleImage.image = new_Image
If anyone has an idea about this, answer. Thanks in advance.
source share