Comments (9)
You can apply a really dirty hack to shift the text down only on the iPhone X.
In CRToast.m -layoutSubviews
add a check to see if the status bar frame is taller than 20. Again, this is hardly tested so it may totally fall over in some circumstances but it at least works in the demo app
If someone has the time to properly test this a build out a better solution please do - I unfortunately do not have the time but just found this kind of worked or at least was a starting point.
Screen Shot & git diff here
diff --git a/CRToast/CRToastView.m b/CRToast/CRToastView.m
index 8a9518d..ce2d2c4 100644
--- a/CRToast/CRToastView.m
+++ b/CRToast/CRToastView.m
@@ -132,6 +132,9 @@ static CGFloat CRCenterXForActivityIndicatorWithAlignment(CRToastAccessoryViewAl
CGFloat preferredPadding = self.toast.preferredPadding;
CGFloat statusBarYOffset = self.toast.displayUnderStatusBar ? (CRGetStatusBarHeight()+CRStatusBarViewUnderStatusBarYOffsetAdjustment) : 0;
+ if (CRGetStatusBarHeight() > 20) {
+ statusBarYOffset += 24;
+ }
contentFrame.size.height = CGRectGetHeight(contentFrame) - statusBarYOffset;
from crtoast.
Came exactly for the same issue. Is there any chance to show the notification under the navigation bar?
from crtoast.
Hey mavris, as far as i know, you can show it as a navigationBar. But under the navigation bar, i am not sure.
from crtoast.
It seems the library needs to be updated to take into account the new "Safe Area" released in iOS 11. Not sure how that would work on an iPhone X running iOS 10 (if that's even possible). Love CRToast – please make this happen!
from crtoast.
Same to me, part of the Title text got covered by the motion detector area(top centre). Stupid iPhone X design.
from crtoast.
My recommendation would to be stop using the status bar for toasts.
You could detect the device and change to navigation bar toasts - or move to navigation bar toasts entirely.
from crtoast.
Can you move the toast to a custom location? If yes, how? Documentation is terrible
from crtoast.
@Ashton-W Even I change to navigation bar toasts, part of the text still got covered by the area.
from crtoast.
Try not using over status bar too, we would need to add code to be aware of safe area to fix it otherwise
from crtoast.
Related Issues (20)
- Xcode 8 and failed to render issue
- Xcode 8 compilation issues
- kCRToastTimeIntervalKey issue with Xcode 8.1 swift 3 HOT 4
- CRToastInteractionResponder crash HOT 4
- Crashes when creating larger toaster HOT 1
- Custom height issue on Swift 3 HOT 1
- Displaying notification while in landscape mode bugged
- CRToast should build without warnings HOT 2
- Toast won't disappear on ios 11 HOT 6
- Can show from nav bar bottom?
- Can't set custom notification height in Swift 3 HOT 1
- Whether to support clicking on the outside of the toast to make it disappear?
- Please Disable Code Coverage HOT 1
- Space between title and subtitle when subtitle is long
- If text is too long, how to fix that? HOT 2
- cleanup warnings
- Solved: Subtitle text not showing
- imkageKey
- Error in Xcode 15.3 HOT 1
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 crtoast.