Xib doesn't save properly with autoresizing mask

324 Views Asked by At

I want to have a custom UITableViewCell that support all orientation.

I created UITableViewCell with xib file and put UILabel to the centre of my cell with flexible width and height attribute. Label has an orange background.

Label's autoresizing masks are shown on screenshot:

enter image description here

And my cell looks like

enter image description here

I didn't added any line of code. I just save and restarted xCode. Now my cell looks like enter image description here

Every time I restarted xCode my label's width increase by 272 px and height by 46 px. I don't know how to fix it.

1

There are 1 best solutions below

0
On

I found out that unchecking flexible width and height of the label (the red cross in your first picture) would fix the problem. I think it has something to do with that its superview doesn't has flexible width and height.