Custom toast question
barrylachapelle opened this issue · 2 comments
barrylachapelle commented
Pre-requisites:
- [ *] Yes, I looked through both open and closed issues looking for what I needed
- [ *] No, I did not find what I was looking for
Nice work guys - question how did you pull off the green bottom aligned toast in the animated gif example exactly? Would love to see an example.
quanshousio commented
You can have a look at the CustomizedToastWithoutToastViewExample
in AdvancedExamples.swift
in ToastUISample
for more detail. Here's the snippet of that example describing the view.
struct ContentView: View {
var text: String
var body: some View {
VStack {
Spacer()
Text(text)
.bold()
.foregroundColor(.white)
.padding()
.background(Color.green)
.cornerRadius(8.0)
.shadow(radius: 4)
.padding()
}
}
}
VStack
is already vertically centered and padded by default, then a Spacer
is used to push the view downward.
barrylachapelle commented
Ack missed the AdvancedExamples - apologies, and thanks for the response. Nice work again.