LucaMs Expert Licensed User Longtime User Nov 24, 2020 #1 I wanted to move an ImageView and at the same time resize its height to zero. B4X: ImageView1.SetLayoutAnimated(1000, ImageView1.Left, ImageView1.Top + ImageView1.Height, ImageView1.Width, 0) That line hides (sets height to 0) immediately the ImageView, instead of take 1 second. Changing the height to just 1dip: B4X: ImageView1.SetLayoutAnimated(1000, ImageView1.Left, ImageView1.Top + ImageView1.Height, ImageView1.Width, 1dip) it works.
I wanted to move an ImageView and at the same time resize its height to zero. B4X: ImageView1.SetLayoutAnimated(1000, ImageView1.Left, ImageView1.Top + ImageView1.Height, ImageView1.Width, 0) That line hides (sets height to 0) immediately the ImageView, instead of take 1 second. Changing the height to just 1dip: B4X: ImageView1.SetLayoutAnimated(1000, ImageView1.Left, ImageView1.Top + ImageView1.Height, ImageView1.Width, 1dip) it works.
Erel B4X founder Staff member Licensed User Longtime User Nov 24, 2020 #2 This is related to the way the animation works. The target settings are set immediately and a cached bitmap is then animated. This means that when the target size is 0 nothing will appear.
This is related to the way the animation works. The target settings are set immediately and a cached bitmap is then animated. This means that when the target size is 0 nothing will appear.
LucaMs Expert Licensed User Longtime User Nov 24, 2020 #3 Erel said: This is related to the way the animation works. Click to expand... This is related to the way the animation badly works Well, I can use a simple workaround, of course: B4X: ImageView1.SetLayoutAnimated(1000, ImageView1.Left, ImageView1.Top + ImageView1.Height, ImageView1.Width, 1dip) Slee(1000) ImageView1.Height = 0
Erel said: This is related to the way the animation works. Click to expand... This is related to the way the animation badly works Well, I can use a simple workaround, of course: B4X: ImageView1.SetLayoutAnimated(1000, ImageView1.Left, ImageView1.Top + ImageView1.Height, ImageView1.Width, 1dip) Slee(1000) ImageView1.Height = 0