简体   繁体   English

更改 uitextfield 在 uiview 中的位置

[英]Changing position of uitextfield in the uiview

I use This one to try to change the position but nothing happends我用这个来尝试改变位置,但什么也没发生

    CGRect frame=timeSpentField.frame;//uitextfield
    frame.origin.y-=100;
    timeSpentField.frame=frame;

What should i do?我该怎么办?

For future programmers with this problem, make sure to always check whether or not you're using auto layout (whether on purpose or by accident).对于未来遇到此问题的程序员,请确保始终检查您是否使用了自动布局(无论是有意还是无意)。 It will stop you from being able to change frame in most instances.在大多数情况下,它会阻止您更改框架。

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

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