Iphone WeeApp中的横向模式
我知道在iOS中有很多关于Iphone WeeApp中的横向模式,iphone,ios,objective-c,jailbreak,Iphone,Ios,Objective C,Jailbreak,我知道在iOS中有很多关于UIDeviceOrientation的问题已经解决了,但是没有人为我工作。我想在小部件中以横向模式为中心制作一个标签 [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; if (([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft) || ([[UIDevice cur
UIDeviceOrientation
的问题已经解决了,但是没有人为我工作。我想在小部件中以横向模式为中心制作一个标签
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
if (([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft) ||
([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight))
{
d = 516; //my var to change the Position (The Value is just a test)
}
因为某些原因,这对我不起作用
提前谢谢。我今天刚刚为我的小部件解决了这个问题。定义方法
- (void)willAnimateRotationToInterfaceOrientation:(int)arg1
用于您的AppController。在内部,检查arg1与的方向相对应
if (UIInterfaceOrientationIsLandscape(arg1)) {
// you're in landscape mode
float screenWidth = [UIScreen mainScreen].bounds.size.height;
}
else {
// you're in portrait mode
float screenWidth = [UIScreen mainScreen].bounds.size.width;
}
您可以在我的文件中看到我的实现。我通过查看的代码找到了它