Comments (5)
2 years past, the bug still there on iOS 10
No one want to solve this bug?
from ios-custom-alertview.
Did you got soultion for this i am facing same issue
from ios-custom-alertview.
@rayalarajee
Try to look and solve as soon as possible time.
from ios-custom-alertview.
Could you please let me know if you found soultion @kemalserkan @timeflying
from ios-custom-alertview.
@rayalarajee @timeflying Hey there!
I Don't know why but when orientation changes screen size remains previous.
Here is the solution or fix:
- (void)changeOrientationForIOS8: (NSNotification *)notification {
CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
UIDevice *device = notification.object;
CGFloat minDim = MIN(screenWidth, screenHeight);
CGFloat maxDim = MAX(screenWidth, screenHeight);
switch (device.orientation)
{
case UIDeviceOrientationPortrait:
screenWidth = minDim;
screenHeight = maxDim;
break;
case UIDeviceOrientationLandscapeLeft:
screenWidth = maxDim;
screenHeight = minDim;
break;
case UIDeviceOrientationLandscapeRight:
screenWidth = maxDim;
screenHeight = minDim;
break;
case UIDeviceOrientationPortraitUpsideDown:
screenWidth = minDim;
screenHeight = maxDim;
break;
default:
break;
}
[UIView animateWithDuration:0.2f delay:0.0 options:UIViewAnimationOptionTransitionNone
animations:^{
CGSize dialogSize = [self countDialogSize];
CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
self.frame = CGRectMake(0, 0, screenWidth, screenHeight);
self->dialogView.frame = CGRectMake((screenWidth - dialogSize.width) / 2, (screenHeight - keyboardSize.height - dialogSize.height) / 2, dialogSize.width, dialogSize.height);
}
completion:nil
];
}
and don' forget to pass [UIDevice currentDevice] as object to notification in init:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceOrientationDidChange:) name:UIDeviceOrientationDidChangeNotification object:[UIDevice currentDevice]];
from ios-custom-alertview.
Related Issues (20)
- TintColor didn't set color in butons HOT 2
- How to let user only tap alertview
- may crash HOT 1
- if I do not want to add subview to windows ,what i do?
- show after close HOT 1
- AttributedString
- Improvement Suggestion
- VoiceOver support HOT 3
- can't install using pods HOT 1
- Alert goes down when the lifecycle application method is called
- impossible to add variable label (IBOutlet) in containerview before [show]
- [GADMobileAds configureWithApplicationID:GAD_AppID];
- 弹不出来 HOT 1
- This Project in Swift 3
- AlertView rotation issue HOT 3
- The solution for show not working after iOS 10
- ot able to show popup
- Not in main thread
- Issue with imagepicker
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ios-custom-alertview.