code // // ContentView.swift // learn_swiftUi // // Created by liuan on 2020/5/14. // Copyright © 2020 liuan. All rights reserved. // import SwiftUI struct ContentView: View { @State private var showDetail = false var body: some View { But
code
// // ContentView.swift // learn_swiftUi // // Created by liuan on 2020/5/14. // Copyright © 2020 liuan. All rights reserved. // import SwiftUI struct ContentView: View { @State private var showDetail = false var body: some View { Button(action: { withAnimation{ self.showDetail = !self.showDetail } }) { Image(systemName:"chevron.right.circle") .imageScale(.large) .rotationEffect(.degrees(self.showDetail ? 90 : 0)) .scaleEffect(showDetail ? 1.5:1) .padding() }} } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }