Questions tagged [swiftui-animation]

228 questions
0
votes
2 answers

VStack flashing of space between views

The VStack has two components header and detail. When we tap on the "show" button, it shows the View (header + detail of the VStack). However, it results in Flashing effect when the view Slides in. After the animation is complete the View spacing…
NNikN
  • 3,720
  • 6
  • 44
  • 86
0
votes
0 answers

Animating navigation bar visibility, content jumps instead of animating smoothly

I want to animate the visibility of the navigation bar, and have the content of the screen smoothly move up and down with it. Applying the animation(_:value:) modifier makes the navigation bar animate smoothly, but the content of the screen jumps…
Rengers
  • 14,911
  • 1
  • 36
  • 54
0
votes
0 answers

Swift UI Card Transition Animation Issue

I'm trying to use a slide transition every time I press draw to deal my cards but it don't do anything except slide the card onetime then another card just pop up without sliding.If I use toggle it works but it goes from false to true which I DON'T…
0
votes
1 answer

A little question about SwiftUI withAnimation repeatForever

I'm a newbie to SwiftUI. I wrote this simple code: struct ani_repeat: View { @State private var xv = false var body: some View { VStack { Text("Hello, World!") .scaleEffect(xv ? 1.5 : 1) …
Blacko
  • 1
  • 1
0
votes
0 answers

SwiftUI, how does the AnyTransition.modifier(active:identity:) works exactly?

In the code below, if I change the part: Image(systemName: "trash.fill") .opacity(state == .active ? opacity : 0.0001) with: Image(systemName: "trash.fill") .opacity(state == .active ? opacity : 0.0) The transition…
Lacm1993
  • 13
  • 3
0
votes
0 answers

SwiftUI Texfield Keyboard Animation Glitch

Im trying to show a TextField inside a SwiftUI Form. The animation for moving the view when the keyboard appears does not look smooth. First, the top section moves under the navigation title before the view moves up completely (which is not possible…
ChrisiOS
  • 11
  • 3
0
votes
1 answer

Glitch on animation expanding view SwiftUI

I have a search bar view, when the view is Expanding, the magnifying glass will appear as a shadow. How can I remove this? ToolbarItem(placement: .automatic) { HStack { if self.showSearchBar { HStack { …
0
votes
1 answer

toolbar animation on extending search bar does not work swiftui

I want to animate the extending search bar. When I press the search button, I want to extend the search bar to left, and when I close the search text field, to collapse to right. ToolbarItem(placement: .automatic) { …
0
votes
2 answers

How can I keep the state of a ScrollView when I "close" a view so as not to return to the beginning of the ScrollView?

I have a horizontal ScrollView, which iterates an array of numbers and for each number a red card is created. When you press a card, that red card expands and only that one is shown. The thing is that when I want to stop expanding the view and go…
j-kobu
  • 3
  • 2
0
votes
1 answer

matchedGeometryEffect works incorrectly

I am practising matchedGeometryEffect. struct ContentView: View { @Namespace var tem @State var isTemp: Bool = true var body: some View{ ZStack{ if isTemp{ Circle() …
test1229
  • 125
  • 9
0
votes
0 answers

transition on button without toggle or withAnimation swiftui

I am trying to add a transition to a button but without using the .toggle() or withAnimation The way that I manage the hide and show the button its with incrementing myValue. var body: some View{ ZStack{ …
0
votes
0 answers

How to animate with .scaleEffect on an image in a ScrollView exclusively when the image is in the center of the screen?

I am using SWIFTUI for iOS16 development of an app. My app is in landscape mode only, and I have a ScrollView horizontal, in the middle of the screen. The ScrollView works fine, however I would like to add a beautiful animation effect so that when…
Pro Girl
  • 762
  • 7
  • 21
0
votes
0 answers

Is there any way in SwiftUI to identify in a ListView which row is currently at a given position of a view

I wanted to provide a zooming effect to the images displayed in a ListView. Each time the list scrolls up & the item reaches top of my visible area. I want to zoom the image a little.
0
votes
1 answer

Present sheet with a TextField and its keyboard in a single animation?

I'm building a SwiftUI to-do app. You tap an Add button that pulls up a partial-height sheet where you can enter and save a new to-do. The Add sheet's input (TextField) should be focused when the sheet appears, so in order to keep things feeling…
0
votes
1 answer

SwiftUI unwanted movement in .animation

Hello and thanks for reading my post. My problem is following: When I start an try to do an loading indicator animation there is an unwanted movement. The Circle should stay in Place and rotate (like a indicator should do), but in my case it move…
MXNL
  • 3
  • 5