ios 如果获取cell上控件相对于屏幕的坐标
2016-12-13 14:29
1086 查看
UIWindow * window=[[[UIApplication sharedApplication] delegate] window]; CGRect frame=[self convertRect: self.bounds toView:window];
textfield不被键盘遮挡
UIWindow * window=[[[UIApplication sharedApplication] delegate] window]; CGRect frame=[self convertRect: self.bounds toView:window];
int offset = frame.origin.y+90 - (SCREEN_HEIGHT - 216.0);//iPhone键盘高度216,iPad的为352
[UIView beginAnimations:@"ResizeForKeyboard" context:nil];
[UIView setAnimationDuration:0.5f];
//将视图的Y坐标向上移动offset个单位,以使下面腾出地方用于软键盘的显示
if(offset > 0)
self.controller.view.frame = CGRectMake(0.0f, -offset, SCREEN_WIDTH, self.controller.view.frame.size.height);
self.controller.submitBtn.frame =CGRectMake(0, SCREEN_HEIGHT -50+100, SCREEN_WIDTH , 50);
[UIView commitAnimations];
相关文章推荐
- iOS 获取控件相对屏幕的坐标位置
- ios 获取控件相对屏幕的位置
- ios 获取控件相对屏幕的位置
- iOS 获取控件相对屏幕的位置
- Android 获取控件相对于屏幕位置
- 获取一个控件相对于父窗口的坐标位置
- android 获取屏幕宽高 和 获取控件坐标
- 如何得到一个控件相对于屏幕左上角的坐标
- MFC对话框应用程序 如何在对话框窗口显示前获取窗口(控件)的屏幕坐标位置
- android 获取控件在屏幕里的坐标
- ccTouchesBegan 中如何让获取的坐标是相对整个屏幕的坐标,而不是在当前view的坐标
- Silverlight如何获取控件的屏幕坐标位置
- MFC对话框应用程序 如何在对话框窗口显示前获取窗口(控件)的屏幕坐标位置
- ios tableView那些事 (十四) 获取 tableview 每个cell 的坐标点
- iOS 获取当前点击的cell相对于self.view的位置
- Android 获取某控件在屏幕中的位置/坐标
- android获取UI控件在屏幕上的坐标
- C# Winform 获取控件在屏幕上的坐标
- android获取控件位置坐标,屏幕尺寸,标题栏,状态栏高度
- VC中获取窗口控件相对客户区的坐标