UIImageView resizes automatically

前端 未结 2 1210
猫巷女王i
猫巷女王i 2020-12-18 11:22

I am trying to set an image to a UIImageView of a SimpleTableCell in a UITableView. I have changed the size of the imageview, but when

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-18 11:50

    When weird resizing behavior happens for me, Autolayout is my first suspect. Try turning Autolayout off and see if the resizing still occurs.

    1. Select the ViewController in the Storyboard or NIB
    2. Click the 'File Inspector' tab on the right hand side of your Xcode window
    3. Under the 'Interface Builder Document' section, uncheck 'Use Autolayout'

    If you need Autolayout you'll probably have to battle it with some code.

提交回复
热议问题