xcode - Autorotation with navigation back button -
I am creating an app that supports all the orientation.
I am using navigation controller. Using this code
- (zero) WilmatorotationTwo interface orientation: (Orientation Orientation) Interface Orientation Period: (NSTEEInterval) Period {if (Interface Orientation == UINFFF Definition Portrait} Interface Orientation == UINPreference Orientation PortraitSupenseDown) {class1. Frame = CGRectMake 54, 68, 190, 174); Category2.frame = CGRectMake (291, 68, 190, 174); Category3.frame = CGRectMake (525, 68, 190, 174); Category4.frame = CGRectMake (54, 296, 190, 174); Category5.frame = CGRectMake (291, 296, 190, 174); Category6.frame = CGRectMake (525, 296, 190, 174); Category7.frame = CGRectMake (54, 527, 190, 174); Category8.frame = CGRectMake (291, 527, 190, 174); Category 9.frame = CGRectMake (525, 527, 190, 174); Category 10.frame = CGRectMake (291, 757, 190, 174); Extra1.frame = CGRectMake (80, 781, 138, 125); Extra2.frame = CGRectMake (551, 781, 138, 125); } Else {class1.frame = CGRectMake (61, 50, 190, 174); Category2.frame = CGRectMake (298, 50, 190, 174); Category3.frame = CGRectMake (537, 50, 190, 174); Category 4.frame = CGRactack (774, 50, 190, 174); Category 5.frame = CGRectMake (61, 278, 190, 174); Category6.frame = CGRectMake (298, 278, 190, 174); Category7.frame = CGRectMake (537, 278, 190, 174); Category8.frame = CGRectMake (774, 278, 190, 174); Category 9.frame = CGRectMake (298, 50 9, 190, 174); Category 10.frame = CGRectMake (537, 50 9, 190, 174); Extra1.frame = CGRectMake (80, 533, 120, 125); Extra2.frame = CGRectMake (800, 533, 120, 125); }} It works perfectly in this view when I go to the second button controller in the tab button, where I am showing the tableview.
However, if I go back to the first view through the navigation back button, the orientation is not fully displayed.
The code above for the navigation back button is not working.
What should I do for this problem ?? Any suggestions ??
Thank you in advance.
Edited:
I have removed my first work from the first scene and copied the code to this function.
- (BOOL) should require aerotartettoenterformationErroration {if (Interface Orientation == UINFterface Orientation Portrait} Interface Orientation == UINPerformance PortraitUpdidDown) {Category 1.frame = CGRactMake (54, 68, 190, 174) ; Category2.frame = CGRectMake (291, 68, 190, 174); Category3.frame = CGRectMake (525, 68, 190, 174); Category4.frame = CGRectMake (54, 296, 190, 174); Category5.frame = CGRectMake (291, 296, 190, 174); Category6.frame = CGRectMake (525, 296, 190, 174); Category7.frame = CGRectMake (54, 527, 190, 174); Category8.frame = CGRectMake (291, 527, 190, 174); Category 9.frame = CGRectMake (525, 527, 190, 174); Category 10.frame = CGRectMake (291, 757, 190, 174); Extra1.frame = CGRectMake (80, 781, 138, 125); Extra2.frame = CGRectMake (551, 781, 138, 125); } Else {class1.frame = CGRectMake (61, 50, 190, 174); Category2.frame = CGRectMake (298, 50, 190, 174); Category3.frame = CGRectMake (537, 50, 190, 174); Category 4.frame = CGRactack (774, 50, 190, 174); Category 5.frame = CGRectMake (61, 278, 190, 174); Category6.frame = CGRectMake (298, 278, 190, 174); Category7.frame = CGRectMake (537, 278, 190, 174); Category8.frame = CGRectMake (774, 278, 190, 174); Category 9.frame = CGRectMake (298, 50 9, 190, 174); Category 10.frame = CGRectMake (537, 50 9, 190, 174); Extra1.frame = CGRectMake (80, 533, 120, 125); Extra2.frame = CGRectMake (800, 533, 120, 125); } Yes return; } In my other view controller, I did
- (BOOL) should be anthorettattoInterfaceArrayation: (UINPerface Orientation) Interface Orientation {return yes; } When I return to the first view by tapping the navigation back button and condition (landscape mode) works fine, but I do not know why this Not working if condition (Portrait Mode)
Type this code in the Function
- (BOOL) should be requiredAurototettoInterfaceAuthentication (UINFterfaceAuthentication) Interface Orientation {// Set Frame according to all Interface Orientation returns Yes; } Edit this new one: : (UINPface Orientation) Interface Orientation {UIViewController * Controller = [self.navigationController.viewControllers objectAtIndex: 0]; [Controller Requires AtteratetoInterface Orientation: Interface Orientation]; Yes come back }
Comments
Post a Comment