Toaster icon indicating copy to clipboard operation
Toaster copied to clipboard

How to show toast on top instead of bottom of screen.

Open sudhanshutil opened this issue 8 years ago • 5 comments

sudhanshutil avatar May 10 '17 18:05 sudhanshutil

This is not yet supported.

devxoul avatar May 16 '17 05:05 devxoul

I think you can use something like this:

let marginTop:CGFloat = 80.0
ToastView.appearance().bottomOffsetPortrait = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height) - marginTop
ToastView.appearance().bottomOffsetLandscape = min(UIScreen.main.bounds.width, UIScreen.main.bounds.height) - marginTop

Pedroalexandrelopes avatar Jun 01 '17 18:06 Pedroalexandrelopes

Thank you @Pedroalexandrelopes. Where would I put this code exactly?

frakman1 avatar Sep 26 '17 15:09 frakman1

You use this on application or ViewController startup

Pedroalexandrelopes avatar Sep 27 '17 00:09 Pedroalexandrelopes

I created this PR to resolve this issue, please take a look https://github.com/devxoul/Toaster/pull/221

trunghvbk avatar Jul 30 '23 09:07 trunghvbk