SwiftUI Text高级用法3D旋转rotation3DEffect(2020年教程)
代码
import SwiftUI
struct Text_Perspective_View: View {
var body: some View {
VStack{
Text("渔家傲·秋思")
Text("""
作者:范仲淹
塞下秋来风景异
衡阳雁去无留意
四面边声连角起
千嶂里,长烟落日孤城闭
浊酒一杯家万里
燕然未勒归无计
羌管悠悠霜满地
人不寐,将军白发征夫泪
""")
.fontWeight(.bold)
.font(.title)
.foregroundColor(.gray)
.multilineTextAlignment(.center)
.padding()
.rotation3DEffect(.degrees(60),axis:(x:1,y:0,z:0))
}
}
}