這段簡單的X偏移影片代碼,當文字是按鈕的一部分時,文字也會在Y軸上移動(在tvOS 14.7上)
struct Animate: View: Animate.
{
@State var scrollText: Bool = false
var body。some View {
Button(action: {}, label: {
Text("This is My Text!")
.offset(x: scrollText ? 0 : 200, y: 0)
.animation(Animation.linear(duration: 1).repeatForever(autoreverses: true))
.onAppear {
self.scrollText.toggle()
}
})
}
}
<
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/319381.html
標籤:
下一篇:Vue3離開影片不作業。過渡問題

