Comments (7)
I'm not a big fan of landscape mode on iphone, even more for pop ups/alerviews that's why i haven't implemented it but i could make it compatible.
from amsmoothalert.
Thanks! I have an app that presents a lot of stuff in landscape (movies, etc) and it would take your cool api over the top!
Im looking through it now to see where I could add it
from amsmoothalert.
If you want to figure it out from yourself, you can have a look to the relative coordinates of the alertview which are based on window frame and not and self.view frame.
And then do a pull request :)
from amsmoothalert.
I could use the landscape-support to, specially for iPad-apps...
from amsmoothalert.
+1 for iPad / landscape support - anyone have any hack's they can share ?
from amsmoothalert.
+100 for iPad / landscape support - does anyone have any hack they can share ?
from amsmoothalert.
This worked for me....
in AMSmoothAlertView.m...
add
#define kCircleViewTag 9999
at the top as a const
at the bottom of
- (void) _initViewWithTitle:(NSString )title andText:(NSString *)text andCancelButton:(BOOL)hasCancelButton forAlertType:(AlertType)type andColor:(UIColor) color
{
//----snipped for brevity ----//
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(deviceOrientationDidChange:)
name: UIDeviceOrientationDidChangeNotification
object: nil];
} - (void)deviceOrientationDidChange:(NSNotification *)notification {
CGRect screenRect = [[UIScreen mainScreen] bounds];
self.frame = screenRect;
alertView.center = self.center;
CGRect circleViewFrame = [self viewWithTag:kCircleViewTag].frame;
circleViewFrame.origin.x =screenRect.size.width/2;
circleViewFrame.origin.y =((screenRect.size.height/2)-alertView.frame.size.height/2);
[self viewWithTag:kCircleViewTag].frame = circleViewFrame;
}
-(void) dealloc{
[[NSNotificationCenter defaultCenter] removeObserver: self];
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
}
the in i add the tag defined at the top to the circle mask view
-
(void) circleSetupForAlertType:(AlertType) type andColor:(UIColor*) color
{UIView * circleMask = [[UIView alloc]initWithFrame:CGRectMake([self screenFrame].size.width/2, (([self screenFrame].size.height/2)-alertView.frame.size.height/2) , 60, 60)];
circleMask.tag = 9999;
//----snipped for brevity ----//
}
P.S. I utterly ditched the background blur view, so this "hack" or "patch" doesnt pay any attention to the blur view/variable.
from amsmoothalert.
Related Issues (20)
- Ability to set alertView size to fit text HOT 5
- Cocoapods GPUImage HOT 7
- README needs updating... HOT 2
- Alternative without GPUImage Framework HOT 7
- Auto dismiss HOT 1
- Pod install warning/error HOT 4
- iOS 8 Performance Issues on device HOT 1
- Landscape HOT 5
- add input text or custom view
- Crash Issue HOT 1
- Compile error on iOS 8 device HOT 4
- Show message by half - IOS 8.4 / Iphone 5S
- If your Reading this do not use this Repo HOT 2
- swift version
- Demo run error!
- In IOS 9.3.1 arm 64 error?
- GPUImage.framework HOT 3
- background blur excludes keyboards
- Planned delegates HOT 3
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 amsmoothalert.