Custom UITableViewCell in edit mode does not move my UILabels

后端 未结 3 922
猫巷女王i
猫巷女王i 2020-12-31 14:25

This is doing my head in:-)

I have a fully functional CoreData Populated UITableView inside a UIViewController and I have successfully impl

3条回答
  •  庸人自扰
    2020-12-31 14:52

    Its a hack but the only thing that worked for me was putting in a hidden image and constraining my labels against it.

    For instance:

    I had a UILabel within a UITableViewCell that wasn't moving with the cell when I animated my table on and off the screen.. but other cells worked just fine. I tried everything.

    I ended up putting an image on the left side of the label (like the other cells had), and adding constraints from the label to the fixed width image, and a constraint from the left of the image to the container.

    This fixed my issue, and now the label animates with the cell.

    I'm not sure what jenky layout is going on with labels, but I tried all of the content modes, and played with settings for well over two hours and nothing else worked.

提交回复
热议问题