ios6 - IOS 6 Orientation -
i working on project , facing problem. problem making project 5.0 , above, project in portrait view 1 view has both view (landscape , portrait) using navigationcontroller custom class , check orientations in custom navigation class `
- (nsuinteger)supportedinterfaceorientations { int interfaceorientation = 0; if (self.viewcontrollers.count > 0) { id viewcontroller; (viewcontroller in self.viewcontrollers) { if ([viewcontroller iskindofclass:([calenderviewcontroller class])]) { interfaceorientation = uiinterfaceorientationmaskall; } else { interfaceorientation = uiinterfaceorientationmaskportrait; } } } return interfaceorientation; }`
calenderviewcontroller view supported both view code works fine popview when pop view calenderviewcontroller, works fine when push new view controller on calenderviewcontroller has portrait view new viewcontroller remains in landscape, whereas should in portrait mode .looking forward solution thanks
in cases this, shouldn't return no
on shouldautorotate
. if that, supported orientations won't checked , controller stuck on last orientation used.
instead, return yes
on shouldautorotate
, specifiy single orientation (portrait) in supportedinterfaceorientations
, do.
returning yes
on shouldautorotate
isn't meant when want controller freely rotate other orientations. should used when might need controller rotate supported orientation after popping or pushing view differently.
Comments
Post a Comment