我正在使用 Push
将 View 从 FirstViewController
导航到 SecondViewContoller
。
在我的 SecondViewContoller
中,我有一个 UITextField
并且我使用此代码来设置 UITextField
的填充。
UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)];
textfield.leftView = paddingView;
textfield.leftViewMode = UITextFieldViewModeAlways;
现在,当我导航时,我的第一个 View 卡在 SecondViewContoller
上。我无法从 SecondViewContoller
中看到任何内容,也无法执行任何操作。
最佳答案
您还可以使用以下方式设置Padding
:
txtPassword!.layer.sublayerTransform = CATransform3DMakeTranslation(10, 0, 0);
关于ios - 将填充设置为文本字段卡住我的屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41301854/