Closed ylai-msrl closed 1 year ago
hey @yoyolty , how do you present the dialog?
.sheet(isPresented: $showingDialog, content: {
GiphyPicker()
.ignoresSafeArea()
})
.ignoresSafeArea()
removes the white box at the bottom on my end:
hi @ALexanderLonsky Thank you for your reply! Originally I used .fullScreenCover to present the view. I followed your code but still the white box exist, did you done any special handling in GiphyPicker? If not, I think there might be some other components in my app that blocks.
hi @ylai-msrl, Sorry about the late reply. Here is a full snippet:
import SwiftUI
import GiphyUISDK
struct GiphyPicker: UIViewControllerRepresentable {
func makeUIViewController(context: UIViewControllerRepresentableContext<GiphyPicker>) -> GiphyViewController {
Giphy.configure(apiKey: "KEY")
let giphy =
GiphyViewController()
GiphyViewController.trayHeightMultiplier = 1.0
giphy.swiftUIEnabled = true
giphy.shouldLocalizeSearch = true
giphy.dimBackground = true
giphy.mediaTypeConfig = [.gifs]
giphy.theme = .init(type: .light)
giphy.modalPresentationStyle = .currentContext
return giphy
}
}
struct ContentView: View {
@State private var showingDialog = false
var body: some View {
Button("Show Giphy Dialog") {
showingDialog.toggle()
}
.padding()
.sheet(isPresented: $showingDialog, content: {
GiphyPicker()
.ignoresSafeArea()
})
}
}
Take a look at this line:
giphy.swiftUIEnabled = true
Is there any way to ignore the bottom safe area? I am using swiftUI, but the .ignoresSafeArea() have no effects towards this white bottom box, I want the view extended to the bottom of phone. Don't know if the white box is the tab bar or safe area. I used .fullScreenCover to present this view. Thank you!