Tig*_*ell 2 iphone uitextview ios
我正在开发一个iPhone应用程序,并试图获得一个简单,可编辑的UITextView工作的Landscape View.
两种接口布局都在NIB文件中指定,并且我已成功加载它们并在设备旋转时迁移数据.
但是,横向版本中的UITextView会从iPhone键盘"跑开",从而无法看到您正在编辑的内容.我不知道为什么这样做 - 有人可以帮忙吗?
提前致谢!
问题视频:http://www.youtube.com/watch?v = hfWBKBA_KjQ
没有一些代码,无法知道你在做什么,但你应该尝试这样的事情:
- (void) animateTextField: (UITextView*) textView up: (BOOL) up
{
const int movementDistance = 80; // tweak as needed
const float movementDuration = 0.3f; // tweak as needed
int movement = (up ? -movementDistance : movementDistance);
[UIView beginAnimations: @"anim" context: nil];
[UIView setAnimationBeginsFromCurrentState: YES];
[UIView setAnimationDuration: movementDuration];
self.view.frame = CGRectOffset(self.view.frame, 0, movement);
[UIView commitAnimations];
}
Run Code Online (Sandbox Code Playgroud)
从你认为合适的地方(例如UIKeyboardWillShowNotigication)调用它,以及它将动画你的视图以显示文本视图.
| 归档时间: |
|
| 查看次数: |
2314 次 |
| 最近记录: |