mirror of
https://github.com/zhigang1992/NoticeView.git
synced 2026-01-12 17:32:41 +08:00
fixed a calculation bug based on view rotation.
This commit is contained in:
@@ -171,12 +171,8 @@ typedef enum {
|
||||
if (0.0 == duration) duration = 0.5;
|
||||
if (0.0 == delay) delay = 2.0;
|
||||
|
||||
// Calculate screen width based on current rotation
|
||||
UIDeviceOrientation orientation = [[UIDevice currentDevice]orientation];
|
||||
// Obtain the screen width
|
||||
CGFloat viewWidth = view.frame.size.width;
|
||||
if ((UIDeviceOrientationLandscapeLeft == orientation) || (UIDeviceOrientationLandscapeRight == orientation)) {
|
||||
viewWidth = view.frame.size.height;
|
||||
}
|
||||
|
||||
// Locate the images
|
||||
NSString *path = [[[NSBundle mainBundle]resourcePath]stringByAppendingPathComponent:@"NoticeView.bundle"];
|
||||
|
||||
Reference in New Issue
Block a user