import SwiftUI
struct DoctorHomePage: View {
@Binding var shouldPopToRootView : Bool
@State var hiddingNavBar = true
@State private var curent: Int? = nil
@State private var profileSegue: Int? = nil
@State private var isActive: Bool = false
let defaults = UserDefaults.standard
let networkRequest = Network()
@State var cancelable: AnyCancellable? = nil
@State var localPatients : [Patients] = []
@Environment(\.colorScheme) var colorScheme: ColorScheme
@State private var isShowing = false
init() {
UINavigationBar.appearance().backgroundColor = .clear
UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
} // I get the error here
var body: some View {
NavigationView {
VStack {
Text("Hello, World!")
}
}
}
}
我正在尝试使用init()来使导航栏透明,但出现错误“在不初始化所有存储属性的情况下从初始化返回”,并且我不知道如何解决。这是我的...
shouldPopToRootView
。