Comments (4)
I'm unable to duplicate. If you go to the sample project and replace self.view
with self.view.window
everything still works as expected. What is the frame of your window?
In general, it's bad practice to add a view directly to the window because it throws off the whole concept of a view hierarchy. Plus those views won't receive important information that is only sent to subviews of the window's root view controller (like rotation events). If you're using a navigation controller, I'd recommend using self.navigationController.view
to present the toast instead.
Send a gist if you're convinced it's a bug in the lib.
from toast.
Thanks for the reply. So it looks like using self.navigationController.view
does present the toast in the correct position and orientation, but it gets hidden under the bottom toolbar if it is called while a view is being popped or presented. Any suggestions in this case?
from toast.
No prob. Is the navigation controller your root view controller (eg: is the navigation controller inside a tab bar controller)? Present the toast in root view controller's view. If the root is in fact the navigation controller, you could try this (hacky) solution:
On line 103 in showToast:duration:position:
in Toast+UIView.m
add this:
toast.layer.zPosition = CGFLOAT_MAX;
That would ensure that the toast is always the top view in that particular view hierarchy.
from toast.
Thanks, setting the zPosition does fix the issue.
This works as well, basically setting a delay before showing the toast so that it does not happen during a v.c. transition:
dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * 0.1);
dispatch_after(delay, dispatch_get_main_queue(), ^(void){
// do work in the UI thread here
[self.navController.view makeToast:message duration:duration position:(id)position];
});
from toast.
Related Issues (20)
- Crash on iOS 11 when displaying a Toast HOT 2
- Hello, can you add animation styles to toast?
- CSToastPositionBottom display not correct running in iPhone X
- Toast appears behind keyboard, not visible to user HOT 1
- how to bind toast in RoboVM
- The position of activity view is not right HOT 1
- Xcode 10 error HOT 2
- Remove existing Toast HOT 1
- Problem on creating loading view with Toast
- Is there a way to block background view?
- 键盘会挡住 HOT 2
- Could not find module 'Toast_Swift' for target 'armv7-apple-ios'; found: arm64, arm64-apple-ios HOT 1
- Toast not working HOT 1
- makeToast got error HOT 1
- Toast is always showing at bottom
- can you add a setting accessibility?
- feature request: verticalOffset(s)
- Hello
- Is it possible to change the size (width height) of the toast?
- how to change activity color
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 toast.