iphone pushviewcontroller เป็นแนวนอน

ฉันมีแอปพลิเคชั่น iphone ที่เรียบง่าย มี 3 วิว มุมมองแรกเป็นมุมมองแนวตั้งที่มี 3 ปุ่ม มุมมองที่สองมีมุมมองตารางซึ่งเป็นแนวตั้งด้วย ในมุมมองแรก เมื่อคลิกปุ่ม มุมมองที่สองจะปรากฏขึ้น เมื่อคลิกเซลล์ในมุมมองที่สอง มุมมองที่สามจะปรากฏขึ้น แต่มุมมองที่สามเป็นทิวทัศน์ ฉันใช้ "pushViewController" เพื่อนำทางจากแต่ละมุมมอง เมื่อสร้างมุมมองใน IB สองมุมมองแรกเป็นแนวตั้ง และมุมมองที่ 3 เป็นแนวนอน ในวิวคอนโทรลเลอร์ตัวที่ 3 ฉันใช้โค้ดต่อไปนี้ด้วย:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//return UIInterfaceOrientationIsLandscape(interfaceOrientation);
return ((interfaceOrientation == UIInterfaceOrientationLandscapeRight) || (interfaceOrientation == UIInterfaceOrientationLandscapeLeft));

}

ฉันจะแสดงสองมุมมองแรกในแนวตั้งและมุมมองที่สามในแนวนอนได้อย่างไร


person Satyam    schedule 19.05.2010    source แหล่งที่มา


คำตอบ (2)


ลองใส่สิ่งนี้ลงใน viewDidLoad

[[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationLandscapeLeft animated:YES];
person emenegro    schedule 19.05.2010

มีชุดลิงก์ไปยังปัญหาที่เกี่ยวข้องในกระทู้นี้ โดยเฉพาะ โปรดดูคำตอบของ pix0r ที่นี่

person user8472    schedule 29.10.2010