hi, i was looking for the ScaleCenter Animation (that on B4A is included in the Animation Library).
There is something to achieve the same result on ios?
Thanks
Yes, it's what i tried to do, but i didn't achieved a good result.
I would like to have a cricle (for semplicity a rectangle) positioned in the center, and then animate it to expand from the center to fill up all the screen. (the pivot in the center not in a corner)
Dim p As Panel
p.Initialize("")
p.Color = Colors.red
Dim h As Int = 100dip
Dim w As Int = 100dip
Page1.RootPanel.AddView(p, 50%x-w/2, 50%y-h/2, w, h)
Sleep(1000)
Dim h2 As Int = 300dip
Dim w2 As Int = 300dip
p.SetLayoutAnimated(1000, 1, 50%x-w2/2, 50%y-h2/2, w2, h2)
I didn't post it because i know it's wrong, i thought there was a similar "ScaleCenter" function somewhere
Dim p As Panel
p.Initialize("")
p.Color = Colors.red
Dim h As Int = 100dip
Dim w As Int = 100dip
Page1.RootPanel.AddView(p, 50%x-w/2, 50%y-h/2, w, h)
Sleep(1000)
Dim h2 As Int = 300dip
Dim w2 As Int = 300dip
p.SetLayoutAnimated(1000, 1, 50%x-w2/2, 50%y-h2/2, w2, h2)
I didn't post it because i know it's wrong, i thought there was a similar "ScaleCenter" function somewhere
i have tried your code on b4j and it works fine. i dont see any issue.
B4X:
Dim p As Pane
p.Initialize("")
CSSUtils.SetBackgroundColor(p,fx.Colors.red)
Dim h As Int = 100dip
Dim w As Int = 100dip
Dim mw, mh As Float
mw = MainForm.RootPane.Width
mh = MainForm.RootPane.Height
MainForm.RootPane.AddNode(p, (mw/2)-(w/2), (mh/2)-(h/2), w, h)
Sleep(1000)
Dim h2 As Int = 300dip
Dim w2 As Int = 300dip
p.SetLayoutAnimated(1000,(mw/2)-(w2/2), (mh/2)-(h2/2), w2, h2)
make sure you do the animation after Page_Resize event!
i would also recommend you to create 2 variables with the height and width of the page that you should set in the page_resize event and then use them instead of using 50%x/50%y. like i do with mw and mh.