Recently, I am modifying an old project. There are many xib files in it. I need to adapt it to iPhone X, but I don't want to rewrite the page to adapt it with code. It is a stupid way to share a small method.
Adapt to the bottom of iPhone X. There is a 34px operation area at the bottom of iPhone X, while other models do not have it. The specific steps are as follows:
1、
2、
3. Double-click the arrow in the figure above to enter the following interface:
Then, there you go!
The above navigation is adapted. I haven't found out how to use it yet. If you have any good way, you can share it. This is a stupid way.
Proceed as follows:
1,
2, the specific code:
self.bgViewTop.constant = NavHeight;
[self.bgView setNeedsLayout];
Then it works!