I want to create a custom UITableViewCell for my iPad which the frame is 768x400, every time I modified(in interface builder) some items on its subviews, it will RESET the width of UITableviewCell(superview) to 320. Xib file is iPad family. my custom cells has a lots of subviews and must support autolayout.
2
votes
I have the same problem. It seems this has been a problem for a while: stackoverflow.com/questions/14375552/…
- jmathew
@jmathew where you able to get this?
- Bordz
Unfortunately not, it looks like a bug. I ended up using the inspector for my adjustments, which was annoying but didn't reset everything.
- jmathew
what you mean is you manually arrange it via inspector? Not touching the view? BTW I really wasn't able how figure out the automatic reset to 320. but my turn around was to programatically code the autolayout..
- Bordz
In Interface Builder, click the element you want to change. Bring up the right side panel. Click the ruler icon and theres the x,y width, height options. When you change the values there the cell width doesn't reset. But programmatically coding the restraints is better. I couldn't do that because I'm working on an existing project.
- jmathew
2 Answers
0
votes
Check the source code of the xib (right click on the file -> Open as). In the forum, you can find descriptions what differs between iPhone and iPad (except size). But I would first try to create new file and ensure that the device family is set to iPad. I already had once the problem after copying stuff from an iPhone xib.