Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/97.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在iPad中开始横向定位?_Ios_Xcode_Ipad_Orientation_Landscape - Fatal编程技术网

Ios 在iPad中开始横向定位?

Ios 在iPad中开始横向定位?,ios,xcode,ipad,orientation,landscape,Ios,Xcode,Ipad,Orientation,Landscape,我已经尝试了iPad应用程序的横向定位,所以在info.plist中做了一些更改 AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

我已经尝试了iPad应用程序的横向定位,所以在info.plist中做了一些更改

AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];

    CGRect screenBound = [[UIScreen mainScreen] bounds];
    NSLog(@"screenBound:%@",NSStringFromCGRect(screenBound));

    return YES;
}
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return UIInterfaceOrientationLandscapeLeft;
}
然后我从CGRect得到屏幕分辨率是屏幕绑定的:{{0,0},{768,1024} 但是我想要{0,0},{1024768},怎么做?请帮帮我


在.plist中提前感谢而不是
UIInterfaceOrientation
使用
UISupportedInterfaceOrientations
,并将横向方向设置为UISupportedInterfaceOrientations列表中的第一个方向。

将此行代码放在AppDelegate.m中

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];

    CGRect screenBound = [[UIScreen mainScreen] bounds];
    NSLog(@"screenBound:%@",NSStringFromCGRect(screenBound));

    return YES;
}
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return UIInterfaceOrientationLandscapeLeft;
}
可能会有帮助: 用这个方法写

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions


[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft];