iOS中强制app竖屏的解决办法

    xiaoxiao2021-03-25  226

    项目默认是横屏的,修改竖屏的方法是在ios/RootViewController.mm修改以下方法: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return UIInterfaceOrientationIsPortrait(interfaceOrientation ); } // For ios6, use supportedInterfaceOrientations & shouldAutorotate instead - (NSUInteger) supportedInterfaceOrientations{ #ifdef __IPHONE_6_0 return UIInterfaceOrientationMaskPortrait; #endif } - (BOOL) shouldAutorotate { return NO; } android项目修改为横屏的方法是修改xml文件: 在AndroidManifest.xml中设置 android:screenOrientation="portrait"
    转载请注明原文地址: https://ju.6miu.com/read-7194.html

    最新回复(0)