ios - How to make a dynamic height UILabel push other elements out of its way? -


Then I have a UILB which is gaining a dynamic amount of content from a database, the more content gets, The height is achieved so that the label is obtained accordingly accordingly.

I have used this code for this purpose:

  NSString * infoztext = [dataBase valueForKey: @ "infos"]; Infoz.text = infoztext; CGSize maxSize = CGSizeMake (320, 410); CGMact Labant = [Infosext binding recovered with size: Maxisy's Options: NSSSDreadingWeinlineFragmentOrgreen Attributes: @ {NSFOutAttractAnalName: InfoFont} Reference: Nil]; Infoz.numberOfLines = 0; Infoz.frame = CGRectMake (23, 594, 274, lab.sct.height);  

It works like a magic label will adjust its amount of content to its height

The problem is that my label Overlapping all the elements in that scene, which is pushed down to them.

I autolayout is enabled but still nothing happens but overlapping

I instead use these elements to override other elements How can I push?

In the interface builder, you can select an element (in this case immediately below your UILBL ) And set the barriers on that label. In the interface builder near the lower right hand corner of the screen, there are 4 icons, select one with a square in between, You can select redish I size between the class and the top text field. After selecting it, click on "Add Ban" and your app should still keep the space between the two elements still fixed after the UILBL size.

Note: You must also have all the elements below the UILBL or you will run the same problem below the screen.

Edit: The four icons given below are "Align," "Pin," "Resolve Auto Layout Problems", "and" Resizing Behavior. "Click on the required icon for the obstacles is" pin "icon and I should be near the top of the small window which decreases.


Comments