[SWIFT] Automatically adjust the height of Xib files

How to automatically adjust the height according to the number of characters when embedding an Xib file in View.

During non-automatic adjustment: The green View is cut off in the middle. Simulator Screen Shot - iPhone 11 Pro Max - 2020-10-24 at 11.52.06.png

After automatic adjustment: The green View is displayed to the end. Simulator Screen Shot - iPhone 11 Pro Max - 2020-10-24 at 11.52.46.png

【Solutions】 Changed the setting of View that displays the Xib file embedded on StoryBoard as follows. Layout→Autoresizing Mask スクリーンショット 2020-10-24 11.49.59.png Set the constraint that you want to be automatically adjusted by Autoresizing. スクリーンショット 2020-10-24 11.50.08.png

Recommended Posts

Automatically adjust the height of Xib files
Automatically adjust the height of the WebView dialog with the size of the content
Automatically set the width and height of the UI Label
[Android] Automatically adjust textScaleX of TextView
[Swift] Get the height of Safe Area
Import files of the same hierarchy in Java
First touch of the Files class (or Java 8)
The first step to using Xib instead of StoryBoard
The world of clara-rules (2)
Automatically start the container
Judgment of the calendar
The world of clara-rules (4)
Summary of jar files
The world of clara-rules (1)
The world of clara-rules (3)
The world of clara-rules (5)
The idea of quicksort
The idea of jQuery
How to check the extension and size of uploaded files