简体   繁体   English

AutoLayout(Xcode 6)上的ScrollView问题

[英]ScrollView issue on AutoLayout ( Xcode 6)

I'm trying to create a registration form for my application. 我正在尝试为我的申请创建注册表。

After droping all desire textfields on scrollView, I have setup its all desire constraints and i'm using "Any H" and "Any W" for Size Class. 在将所有所需的文本字段拖放到scrollView上之后,我已经设置了所有所需的约束,并且我为Size Class使用了“ Any H”和“ Any W”。

on Storyboard its showing warning for textField width, when i ran this on device it shrink the textfield, see below images 在Storyboard上,它对textField宽度显示警告,当我在设备上运行它时,它会缩小textfield,请参见下图

在此处输入图片说明

Please Help me. 请帮我。

You should add your textfield to scrollview with "horizontal centre in container". 您应该使用“容器中的水平中心”将文本字段添加到scrollview。 That means how much your scrollview width is increase/decrease your textfield will remain in centre with its leading and trailing constraint constant. 这意味着您的scrollview宽度增加/减少了多少,您的文本字段将在其前导约束和尾随约束恒定的情况下保持居中。 So it will adjust its width as per scrollview width. 因此它将根据scrollview宽度调整其宽度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM