Sunday 15 February 2015

ios - How to call drawRect after an orientation rotation animation is completed -


I am trying to use drawRect to draw a rectangular in space under a collection. See the code below) to define the rectangle by using the frame of both scenes.

This code works fine till device orientation changes. Whatever the call I have tried, draw everything before animated rotation. This means that collectionView.frame and self.frame have not yet been adjusted by autoplay and the resulting rectangle is incorrect.

  CGRect frame = self.collectionViwOutlet.frame; CGFloat x = frame.orine.x; CGFloat y = frame.corein.a + frame.edame.height + 8; CGFloat w = frame. Size.width; CGFloat h = self.frame.origin.y + self.frame.size.height - y - 8; CGRact drawrect = secretemake (X, Y, W, H);  

Any suggestion would be appreciated.

Override your custom UIView there layoutsview , which is for you by the system It will be necessary when necessary and when all the variables (orientation, size, etc)

PS: Consider this:


No comments:

Post a Comment