Dynamically hiding view in SwiftUI

前端 未结 7 1285
-上瘾入骨i
-上瘾入骨i 2020-12-24 10:41

I\'m trying to conditionally hide a DatePicker in SwiftUI. However, I\'m having any issue with mismatched types:

var datePicker = DatePicker($da         


        
7条回答
  •  孤独总比滥情好
    2020-12-24 11:18

    You also have the opacity modifier on any View:

    ActivityIndicator(tint: .black)
       .opacity(self.isLoading ? 1.0 : 0.0)
    

提交回复
热议问题