Comments (5)
I have put this in LNNotificationBannerWindow but i know it will overwrite on the pods update for the fixes you may do to improvise this component.
-(UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationPortrait;
}
Can we have a handle outside to lock or access this.
from lnnotificationsui.
How do you lock your the orientation of your app? Have you set the correct orientation in the app plist?
Another option is to implement - (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
in your app delegate, and provide the portrait orientation there.
I am not sure how to solve this. Each window allows its controller stack to determine the allowed orientation. So I could query the main window's allowed orientation, but this is incorrect, as there may be multiple windows alive, each with different supported orientations. Another option is to display notifications only in the orientation the interface was at the time of presentation. I don't like this because the experience suffers for all other applications where rotation is supported.
from lnnotificationsui.
Hello LeoNatan,
I have implemented the stack in every controller to past the code that will determine what orientation is supported in the view controller.
`
-(BOOL)shouldAutorotate
{
return YES;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations{ //NSLog(@"supported called in red 1");
return UIInterfaceOrientationMaskPortrait;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return toInterfaceOrientation == UIInterfaceOrientationPortrait;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationPortrait;
}
Also the customised navigation controller have this code.
- (BOOL)shouldAutorotate {
return [[self.viewControllers lastObject] shouldAutorotate];
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return [[self.viewControllers lastObject] shouldAutorotateToInterfaceOrientation:toInterfaceOrientation];
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}
As i have some view controller that support both orientation so the above APPDelegate fix is not good. Please suggest me some solution over this.
from lnnotificationsui.
I just tested on my demo project.
If the project is defined correctly to only support portrait, notifications do not rotate. Define like so:
If your entire app is portrait, you should remove all your functions and just use that.
from lnnotificationsui.
No my few pic gallery full screen views are supporting both orientation hence I can't use the settings above as u mentioned
from lnnotificationsui.
Related Issues (20)
- Add option for action buttons to show on banners HOT 2
- Getting error in iOS9 dispatch_once HOT 4
- '/Users/**/Documents/**/Carthage/Build/iOS/LNNotificationsUI.framework/LNNotificationsUI' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build for architecture arm64 HOT 1
- Swipe the notification to ignore always acts like tapping. HOT 8
- Crash in +[LNNotificationAppSettings load] when statically compiled. HOT 1
- registerApplicationWithIdentifier crashes if image is not provided. HOT 2
- iOS7 Support HOT 1
- background music is not resumed after notification is dismissed HOT 3
- Making some properties public HOT 6
- Pods not installing this library HOT 2
- CocoaPods install: Git source not founded HOT 1
- Support cocoa pod and/or carthage? HOT 1
- Cartfile path is pointing to a different project in readme.md HOT 2
- Date parameter is ignored in [LNNotification notificationWithMessage:title:icon:date:] HOT 1
- Add cocoapods support HOT 3
- How LNNotificationBannerWindow show? HOT 1
- How to detect swiped away status?
- Module LNNotificationUI not found error. HOT 10
- have a doubt in LNNotificationbannerwindow 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 lnnotificationsui.