ios8 cell constraints break when adding disclosure indicator

前端 未结 3 731
梦谈多话
梦谈多话 2020-12-29 21:36

I have a problem with auto layout on IOS8, the simplest case I can recreate is a simple tableView. I setup a static cell and then simply add a label.

My aim is to h

3条回答
  •  粉色の甜心
    2020-12-29 22:15

    I just had the same problem. I want to layout an image-view on the left hand with a label on its right which fills the space between the image-view and the right (or trailing) border of superview (which is the cell's content-view). Accessory view is set to disclosure indicator as well. As in your case the conflicting constraints where all H-based and one I found in the logs where fittingSizeHTarget. I didn't found out what this means nor where this was coming from, but I found your post here.

    The following did the trick for me:

    Lower the priority of your label's trailing-to-superview constraint. (I chose 990).

    I assume, that the layout system (with the disclosure indicator visible) for what ever reason can't satisfy all the constraints anymore, so it breaks one. But if you lower the priority, it still tries to satisfy the constraint, but doesn't break it as the conflicting constraint(s) have higher priority.

    Hope this solves your problem as well.

提交回复
热议问题