{"id":1107,"date":"2020-09-28T22:01:37","date_gmt":"2020-09-28T14:01:37","guid":{"rendered":"http:\/\/123.57.164.21\/?p=1107"},"modified":"2020-09-28T22:01:37","modified_gmt":"2020-09-28T14:01:37","slug":"swiftui-%e6%af%9b%e7%8e%bb%e7%92%83%e6%95%88%e6%9e%9c","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=1107","title":{"rendered":"SwiftUI \u6bdb\u73bb\u7483\u6548\u679c"},"content":{"rendered":"\n<p>\u901a\u8fc7UIVisualEffectView\u53ef\u4ee5\u5b9e\u884c\u6bdb\u73bb\u7483\u6548\u679c\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">struct VisualEffectView: UIViewRepresentable {\n    var effect: UIVisualEffect?\n    func makeUIView(context: UIViewRepresentableContext&lt;Self>) -> UIVisualEffectView { UIVisualEffectView() }\n    func updateUIView(_ uiView: UIVisualEffectView, context: UIViewRepresentableContext&lt;Self>) { uiView.effect = effect\n        uiView.alpha = 0.6\n    }\n}\n<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">struct ContentView: View {\n\n    var body: some View {\n        ZStack {\n            Image(\"BG\")\n                .resizable()\n                .scaledToFill()\n                .edgesIgnoringSafeArea(.all)\n            \n            VisualEffectView(effect: UIBlurEffect(style: .dark))\n                .edgesIgnoringSafeArea(.all)\n                \n            Text(\"Hello \\nVisual Effect View\")\n                .font(.largeTitle)\n                .fontWeight(.black)\n                .foregroundColor(.white)\n        }\n    }\n}<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"280\" height=\"150\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2020\/09\/image-38.png\" alt=\"\" class=\"wp-image-1108\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2020\/09\/image-38.png 280w, https:\/\/92it.top\/wp-content\/uploads\/2020\/09\/image-38-230x123.png 230w\" sizes=\"(max-width: 280px) 100vw, 280px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u901a\u8fc7UIVisualEffectView\u53ef\u4ee5\u5b9e\u884c\u6bdb\u73bb\u7483\u6548\u679c\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/1107"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1107"}],"version-history":[{"count":1,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/1107\/revisions"}],"predecessor-version":[{"id":1109,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/1107\/revisions\/1109"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}