Environment: Xcode + Swift 4
I following the tutorial Start Developing iOS Apps (Swift) to create a app that using UITableView to show the meals, entering editing mode to delete meals, and other functions.
My problem is when I enter editing mode, the right-most star is overlapped by the delete button:
The tutorial says
To fix this, you need to lay out the cell using nested stack views and Auto Layout constraints; however, that is left as an exercise for the reader.
The five stars are embedded in a custom horizontal stack view. And the horizontal stack view and a label are embedded in a vertical stack view.
The image view has following constraints:
And the vertical stack view has following constraints:
I try to add a new constraint on the vertical stack view to solve the problem:
But the right-most star will be shrunk:
How to prevent the right-most star from being overlapped or shrunk by the delete button?
Many thanks.