[英]iOS Autolayout with multiple views with dynamic heights
I'm trying to achieve the following: 我正在努力实现以下目标:
MyViewcontroller MyViewcontroller
Now that is easier enough in an XIB file. 现在,在XIB文件中这已经足够容易了。
However, I want to be able call something like MyCustomTextField showError:@"an error" and this to change the height (to say 80) of the related field (animated). 但是,我希望能够调用MyCustomTextField showError:@“错误”之类的东西,以更改相关字段(动画)的高度(例如80)。
Can someone describe how to do this with Autolayout? 有人可以描述如何使用自动排版吗? My main issue is ensuring the other 'MyCustomTextField's move down at the same time, as the height of the previous field will have increased.
我的主要问题是确保另一个“ MyCustomTextField”同时向下移动,因为前一个字段的高度将增加。
Any help or pointers would be appreciated. 任何帮助或指针,将不胜感激。
You can try the below approach; 您可以尝试以下方法;
Hope this helps you. 希望这对您有所帮助。
开始工作-我在myviewcontroller中为高度设置了约束,这是错误的,这阻止了它增加高度。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.