Tôi đã tạo danh mục để xoay chế độ xem và thêm chế độ xem trên giao diện điều khiển cũng như trên cửa sổ (để hiển thị chỉ báo tùy chỉnh). Mã của tôi hoạt động tốt đến 7.X với xCode 5.X cũng như xCode6-beta6. Nhưng không phù hợp với iOS 8 beta. Nó có vẻ như xoay cửa sổ không hoạt động với ios 8 beta giống như ios cũ hơn.Sự cố xoay vòng với ios 8 cho chế độ xem được thêm vào cửa sổ
Bạn có thể đề nghị tôi .... Cảm ơn rất nhiều trước.
Mã của tôi là trông giống như
- (void)application:(UIApplication *)application willChangeStatusBarOrientation:(UIInterfaceOrientation)newStatusBarOrientation duration:(NSTimeInterval)duration {
if(!self.isIpad)
{
[menu.view rotateViewToOrientation:newStatusBarOrientation animated:YES];
if(newStatusBarOrientation==UIInterfaceOrientationPortrait || newStatusBarOrientation==UIInterfaceOrientationPortraitUpsideDown)
{
if (IS_IPHONE_5) {
menu.view.frame= CGRectMake(0, 518, 320, 50);
} else {
menu.view.frame= CGRectMake(0, 430, 320, 50);
}
} else if(newStatusBarOrientation==UIInterfaceOrientationLandscapeLeft) {
if (IS_IPHONE_5) {
menu.view.frame= CGRectMake(270,0,50,568);
} else {
menu.view.frame= CGRectMake(270,0,50,480);
}
} else {
if (IS_IPHONE_5) {
menu.view.frame= CGRectMake(0,0,50,568);
} else {
menu.view.frame= CGRectMake(0,0,50,480);
}
}
[menu reloadMenu];
}
}
//Method of Menu Class for orientation change setup
- (void)rotateViewToOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
CGPoint center = self.center;
CGRect bounds = self.bounds;
CGAffineTransform transform = CGAffineTransformIdentity;
int intOri=orientation;
switch (intOri) {
case UIInterfaceOrientationPortraitUpsideDown:
transform = CGAffineTransformMakeRotation(M_PI);
break;
case UIInterfaceOrientationLandscapeLeft:
transform = CGAffineTransformMakeRotation(-M_PI_2);
break;
case UIInterfaceOrientationLandscapeRight:
transform = CGAffineTransformMakeRotation(M_PI_2);
break;
case UIInterfaceOrientationPortrait:
transform = CGAffineTransformMakeRotation(0);
break;
}
if (animated) {
[UIView beginAnimations:nil context:nil];
}
self.transform = transform;
bounds = CGRectApplyAffineTransform(bounds, transform);
self.bounds = CGRectMake(0, 0, bounds.size.width, bounds.size.height);
self.center = center;
if (animated) {
[UIView commitAnimations];
}
}
dán một số mã và hiển thị như thế nào bạn nhận được vấn đề, là có bất kỳ chức năng không được gọi điện thoại hoặc bất cứ điều gì khác ?? – Jageen
nói chung hầu hết các nhà phát triển không có ý tưởng làm thế nào một hệ thống phân cấp xem thích hợp nên được xây dựng, và đó có thể là nguồn gốc của vấn đề - bạn có thể đăng một số mã về cách bạn xây dựng của bạn? – holex
@ Jageen Tôi đã thêm mã của tôi, Bạn có thể vui lòng đề xuất cho tôi bất kỳ cách nào không, tôi nên làm gì để làm cho ứng dụng của tôi tương thích với iOS 8. –