iOS 8 gray box over UITableView

后端 未结 4 1599
醉酒成梦
醉酒成梦 2021-02-20 15:21

I am making an app where I need to use UITableViews to display content in an organized fashion, but since I updated to iOS 8 and Xcode 6 I have been getting a myste

4条回答
  •  伪装坚强ぢ
    2021-02-20 15:36

    In iOS 8 the row height can be set automatically for you. All you have to do is set a top and bottom constraint to the contentView of the UITableViewCell, like this (notice the constraints):

    Interface builder - defining the uitableviewcell

    By doing this, the row height will be automatic and you won't need to set a fixed height. This fixes the gray background color you have encountered.

    Resource: http://www.shinobicontrols.com/blog/posts/2014/07/24/ios8-day-by-day-day-5-auto-sizing-table-view-cells

提交回复
热议问题