
嗨,
我们能找到旋转后被遮蔽的UI元素的坐标吗,比如UItextfield,如果可以,怎么可能呢?
提前感谢

发布于 2011-04-13 22:59:13
我不确定我是否理解了你的问题。如果你想知道设备旋转后UI元素的坐标,你可以这样做:
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
CGRect newFrame = someUIElement.frame;
int x = newFrame.origin.x; // x-Coordinate
int y = newFrame.origin.y; // y-Coordinate
// do stuff with coordinates
}发布于 2011-04-13 23:23:52
我有一些像旋转设备时的法比安答案,首先调用的方法是持续时间,然后是-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; }:(NSTimeInterval)duration
最后
调用-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation方法,你可以得到这个method.The中的坐标,这里主要的事情是对象的原点会改变,而不是size.this,这是我期望从一些示例应用程序中得到的东西。
https://stackoverflow.com/questions/5650617
复制相似问题