iOS Question SetLayoutAnimated on a circle

Alexander Stolte

Expert
Licensed User
Longtime User
Is this possible in B4I?
"Setting radius in viewWillLayoutSubviews will solve the problem"
B4X:
override func viewWillLayoutSubviews() {
  super.viewWillLayoutSubviews()
  profileImageView.layer.cornerRadius = profileImageView.frame.height / 2.0
}
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
Is this possible in B4I?

Possible (with modifications). But there is a difference in IOS releases.
For example, in IOS 13 you will not receive viewWillLayoutSubviews during animation.

Guess, better to animate 'manually' (to resize/move by timer).
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
Let's look DrawAnimatedCircle in Button1_Click. Parameter #4 (radius1) is initial size, parameter #8 (radius2) is final size. You can simply exchange values.
B4X:
    DrawAnimatedCircle (1000, Page1.RootPanel.Width / 2, Page1.RootPanel.Height / 2, 0.2 * Min (Page1.RootPanel.Height, Page1.RootPanel.Width), Page1.RootPanel.Width / 2, Page1.RootPanel.Height / 2, 0.05 * Min (Page1.RootPanel.Height, Page1.RootPanel.Width))
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Thank you, I have mentioned you as thanks that I could reach my goal!
 
Upvote 0
Top