autolayout - Detecting iOS 8 Orientation change in UIView -
i detecting regular , compact size classes traitcollectiondidchange in ios8.
i trying fit particular set of data horizontally across screen , not fit in horizontal class regular on portrait ipad mini there plenty of space in landscape.
the problem horizontal sizeclass regular in portrait , landscape traitcollectiondidchange not fire , don't told orientation change.
i have heard reference viewwilltransitiontosize
not available in uiview.
are apple saying not want ui layout diffs horizontal class regular - portrait , horizontal class regular - landscape?
if it's ok how told, in uiview, orientation change?
just add method -(void) layoutsubviews uiview subclass. called time view's dimensions change. don't forget call [super layoutsubviews] inside new method.
then can check self.traitcollection.verticalsizeclass , self.traitcollection.horizontalsizeclass see you're looking at.
-(void) layoutsubviews { [super layoutsubviews]; // code here... }
Comments
Post a Comment