[img]https://i .stack.imgur.com/j2hhK.gif[/img]
Вот мой код:
`struct ContentView: View
{
@State var Scale = 0,1
Код: Выделить всё
var body: some View
{
NavigationStack
{
VStack
{
Text("")
.frame(width: getScreenBounds().width * 0.80, height: getScreenBounds().height * 0.03)
Image("CVT1")
.resizable()
.scaledToFill()
.frame(width: getScreenBounds().width * 0.80, height: getScreenBounds().height * 0.05)
.scaleEffect(scale)
.onAppear
{
let baseAnimation = Animation.smooth(duration: 3)
let repeated = baseAnimation.repeatCount(3)
withAnimation(repeated)
{
scale = 1.0
}
}
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/781 ... en-animate
Мобильная версия