iOS: Items in custom UITableViewCell not showing up consistently. Storyboard bug?

你说的曾经没有我的故事 提交于 2019-12-25 04:22:48

问题


I have encountered one peculiar situation where items I included (UILabels, UIButtons, etc) in my UITableViewCell does not show up in a consistent way, i.e.: If I try add-in new items, they do not show up although I've made sure that proper connections have been made.

I even tried deleting the prototype cell and re-do the prototype cell from scratch. Now, it's even more weird, nothing is showing up when I run the app in both my simulator and device.

A few possibilities I think could have contributed to the problem:

  1. There's a bug in xCode 6.1 and xCode 6.1.1
  2. There's a bug in Storyboard
  3. The items's frame (x,y,height,width) are somehow screwed up during runtime. I use autolayout.
  4. The storyboard or my project's config stuff are messed up somehow.

I have totally no idea on how to fix it. Any wise hard-core coder out there able to help? My source code folder is here for your reference: http://dropbox.com/sh/v1prxriqd7pcsws/AABbjYCPwlTMfzgY4Y2xh-PJa?dl=0

*Note: The TableViewController involved is "NewsFeedPageTableViewController", Cell class involved is "NewsFeedCell", and in the file, the specific problem you may find is the coverImage item which is currently not showing when the app runs. Try add in new items, and be surprised that they won't show up either. Try re-do the cell and be surprised still!

Need Help!


回答1:


The UIImageView in the cell is uninstalled fro size classAny Any, but is installed for size class reg reg - so it will only appear on iPad devices.

The image view is also missing constraints, so there are layout errors. When I installed it for Any Any and added constraints it appeared



来源:https://stackoverflow.com/questions/27917476/ios-items-in-custom-uitableviewcell-not-showing-up-consistently-storyboard-bug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!