ยกตัวอย่างการ toggle ไปมาระหว่ง UI แนวตั้งกับแนวนอน สามารถทำได้ดังนี้
if(UIInterfaceOrientationIsPortrait(self.interfaceOrientation)){
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
}else{
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait];
}
0 comments:
Post a Comment