The background behind my HStacks is not the same. Can anyone help? I need to get rid of the black outlines in the HStack. Please and Thank you.
import WebKit
struct WebView: UIViewRepresentable{
let request : URLRequest
private var webView: WKWebView?
init (request: URLRequest){
self.webView = WKWebView()
self.request = request
}
func makeUIView(context: Context) -> WKWebView{
return webView!
}
func updateUIView(_ uiView: WKWebView, context: Context) {
uiView.load(request)
}
func goBack(){
webView?.goBack()
}
func goForward(){
webView?.goForward()
}
func goHome(){
webView?.load(request)
}
func refresh(){
webView?.reload()
}
}
struct ContentView: View {
let webView = WebView(request: URLRequest(url: URL(string: "https://www.itechmania.it/")!))
var body: some View {
ZStack {
Color.init(red: 0, green: 0.4157, blue: 0.5686 )
.ignoresSafeArea([.all])
webView
}
HStack{
Button(action: {
self.webView.goBack()
}) {
Image(systemName: "arrow.backward.circle")
.font(.title)
.foregroundColor(.white)
.padding()
}
Spacer()
Button(action: {
self.webView.goHome()
}) {
Image(systemName: "house.fill")
.font(.title)
.foregroundColor(.white)
.padding()
}
Spacer()
Button(action: {
self.webView.refresh()
}) {
Image(systemName: "arrow.clockwise.circle.fill")
.font(.title)
.foregroundColor(.white)
.padding()
}
Spacer()
Button(action: {
self.webView.goForward()
}) {
Image(systemName: "arrow.forward.circle")
.font(.title)
.foregroundColor(.white)
.padding()
}
}
.background(Color.init(red: 0, green: 0.4157, blue: 0.5686))
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}