UILabel Parentview size According to Text in UILabel

suggest change

Step by Step Guide :-

Step 1 :- Set constraint to UIView

  1. Leading. 2) Top. 3) Trailing. (From mainview)

Step 2 :- Set constrain to Label 1

  1. Leading 2) Top 3) Trailing (From it’s superview)

Step 3 :- Set constraint to Label 2

  1. Leading 2) Top 3) Trailing (From its superview)

Step 4 :- Most tricky give a bottom to UILabel from UIView .

Step 5 :- (Optional) Set constrain to UIButton

  1. Leading 2) Bottom 3) Trailing 4) Fixed Height (From mainview)

Output :-

Note :- Make sure you have set Number of lines =0 in Label property.

I hope this info enough to understand Autoresize UIView according to UILabel’s height and Autoresize UILabel According to text.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Auto Layout:
* UILabel Parentview size According to Text in UILabel

Table Of Contents
11 Auto Layout
12 UIView
15 UIColor
26 UIImage
28 CALayer
30 NSDate
40 iBeacon
49 NSTimer
79 NSURL
87 AWS SDK
96 NSData
101 Segues
104 EventKit
105 NSBundle
106 SiriKit
111 StoreKit
117 3D Touch
119 Keychain
122 Block
141 AirDrop
144 UISlider
145 Carthage
146 HealthKit
151 plist
157 MVVM
164 UIPhoenix
166 Simulator
168 NSArray
169 OpenGL
175 Core Data
179 MyLayout
180 UIFont
189 Security
200 Codable