已UITextView插入UITabBarController(在iPhone上)的标签中.
UITextView很多行.发生了什么?键盘UITextView用光标隐藏了一半.无法编辑文本作为结果.
如何解决所有Apple移动设备(具有不同屏幕分辨率)的问题?非常感谢您的帮助!
我正在研究一个快速而肮脏的笔记应用,纯粹是为了尝试理解自动布局.因此,我正在寻找针对此问题的特定于自动布局的解决方案.
我很确定我的术语和对这个主题的理解可能在某些地方是不正确的,所以如果我通过无知而错误地忽略或省略信息,否则我将非常乐意用更好的细节来更新这个问题.
有关此问题的简短视频,请访问:http:
//pile.cliffpruitt.com/m/constraint_problem.mp4
这是执行动画的代码:
// self.bodyFieldConstraintBottom refers to an outlet referencing the UITextView's bottom constraint
// This animation occurrs when the text view is tapped
- (BOOL)textViewShouldBeginEditing:(UITextView *)textView
{
[self enterEditingMode];
[UIView animateWithDuration:2.35
animations:^{
NSLayoutConstraint *bottom_constraint = self.bodyFieldConstraintBottom;
bottom_constraint.constant = 216;
[self.view layoutIfNeeded];
}];
return YES;
}
// This animation occurrs when editing ends and the text field size is restored
- (BOOL)textViewShouldEndEditing:(UITextView *)textView
{
[self exitEditingMode];
[UIView animateWithDuration:2.35 …Run Code Online (Sandbox Code Playgroud)