Table View Cell Row Height doesnt work

前端 未结 8 1048
故里飘歌
故里飘歌 2021-02-05 03:39

I have tried to hard code the row height in the table view cell. After running the program it looks like only one line. I suspect it is because of the height of the row

8条回答
  •  醉话见心
    2021-02-05 03:59

    Following this guide which worked for me, you have to add a bunch of constraints and then the rowheight is calculated automatically.

    In short, what I did: (adding and modifying constraints are the two rightmost buttons bottom right of the storyboard view)I at first selected all views in the prototype cell, deleted all constraints (there is a nice option on the rightmost button), then added all missing constraints (another nice option there) and last I chose the second button from the right and clicked all the red lines. You can do this while having all views selected at the same time. And then it worked.

提交回复
热议问题