I am working on an ios application using autolayout,
I have a UITextField and a UIButton next to it horizontally.
The UIButton text is changed dynamically. It ca
Try these autolayout constraints:
UITextField
object's width constraint should be a Less Than or Equal
relationUIButton
object's width constraint should be a Greater Than or Equal
relationUITextField
object's horizontal Content Hugging Priority
should be 249 (as per my constraint settings shown above)And related code as:
[buttonObject setTitle:@"Button title is too... zzz" forState:UIControlStateNormal];
[buttonObject sizeToFit];
...or something along these lines
increase button horizontal content hugging priority
such that it is higher than the adjacent components' horizontal content hugging priority