Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only rotate KRImageView #3

Open
appmonkey8010 opened this issue Jul 8, 2013 · 1 comment
Open

only rotate KRImageView #3

appmonkey8010 opened this issue Jul 8, 2013 · 1 comment

Comments

@appmonkey8010
Copy link

If you want to rotate only! your KRImageView(like Facebook) and not your whole application you can add following to your view did Load:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didRotate)
name:UIDeviceOrientationDidChangeNotification
object:nil];

to oberve rotation and fire a event to change only the KRImageview.
And then you can rotate like you want with:

-(void)didRotate {
UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice] orientation];

[self.krImageViewer reloadImagesWhenRotate:deviceOrientation];

}

Its better then:
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[self.krImageViewer reloadImagesWhenRotate:toInterfaceOrientation];
}

Because if you have a only Portrait Mode App, you might get problems.

@Kalvar
Copy link
Owner

Kalvar commented Jul 9, 2013

Thanks, Buddy.

That's really a great idea, awesome !
I fixed it and added some methods to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants