{"id":136161,"date":"2020-07-21T22:47:06","date_gmt":"2020-07-21T14:47:06","guid":{"rendered":"http:\/\/4563.org\/?p=136161"},"modified":"2020-07-21T22:47:06","modified_gmt":"2020-07-21T14:47:06","slug":"swiftui-transition-%e5%85%b3%e8%81%94-animation-%e4%b8%8d%e7%94%9f%e6%95%88","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=136161","title":{"rendered":"SwiftUI transition \u5173\u8054 animation \u4e0d\u751f\u6548"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  SwiftUI transition \u5173\u8054 animation \u4e0d\u751f\u6548               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : IsaacYoung <\/span>  <span><i><\/i> 13<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u70b9\u51fb\u6309\u94ae\u4f7f Text \u5c55\u793a\u51fa\u6765\uff0c\u5728 transition \u7684\u4f7f\u7528 animation \u8bbe\u7f6e\u5ef6\u8fdf 2s\uff0c\u5b9e\u9645\u7ed3\u679c\u5e76\u6ca1\u6709\u5ef6\u8fdf\uff0c\u4e3a\u4ec0\u4e48\u4f7f\u7528 .opacity \u53ef\u4ee5\uff0c \u4f7f\u7528.offset \u65e0\u6cd5\u51fa\u53d1\u52a8\u753b\u6548\u679c\uff0c\u6c42\u5927\u4f6c<\/p>\n<pre><code>  import SwiftUI  struct ContentView: View {     @State private var show = false          var body: some View {         VStack {             Spacer()                          if show {                 Text(\"AAAA\")                     .transition(                         AnyTransition                             \/\/                            .offset(x: 100, y: 100)                             .opacity                             .animation(                                 Animation                                     .easeInOut(duration: 1)                                     .delay(5)                         )                 )             }                          Spacer()                          Button(\"\u70b9\u51fb\") {                 self.show.toggle()             }             .padding()         }     } }    <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>0<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>SwiftUI transitio&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/136161"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=136161"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/136161\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=136161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=136161"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=136161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}