简体   繁体   中英

UITableViewCell wrong width on iPad?

My tableview size is 500 by 500. I am creating a UITableViewCell and setting it's style as default in init method. However, when I log the frame of the cell, it comes out as 320. Is this normal? Thanks

Also, for some reason, I can't use the reuse identifier if I init the cell with a frame.

It's perfectly possible that UITableViewCell 's initializer just hardcodes the width to 320 points. After all, at this point the cell does not yet belong to a table view so it can't possibly know its final size.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM