亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

試過了下面兩個方法都無效,請問該怎么辦?

試過了下面兩個方法都無效,請問該怎么辦?

iOS
阿晨1998 2023-04-18 14:10:11
ipad 應用 鎖定lanscape狀態不變,無論怎么旋轉,如何實現- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation  {  return UIInterfaceOrientationIsLandscape(interfaceOrientation); }還有(BOOL)shouldAutorotateToInterfaceOrientation:UIInterfaceOrientation)interfaceOrientation  {  return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); }我用的是ios6
查看完整描述

1 回答

?
PIPIONE

TA貢獻1829條經驗 獲得超9個贊

如果整個程序都要橫屏,plist中修改下最省事。

	<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationLandscapeLeft</string>
	</array>

或者代碼中viewcontroller加,

- (BOOL)shouldAutorotate
{    return NO;
}

- (NSUInteger)supportedInterfaceOrientations
{    return UIInterfaceOrientationMaskLandscapeRight;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{    return UIInterfaceOrientationLandscapeRight;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}


查看完整回答
反對 回復 2023-04-20
  • 1 回答
  • 0 關注
  • 158 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號