Android Question Problem with SetRotationAnimated

Filippo

Expert
Licensed User
Longtime User
Hi,

Can someone explain to me why the “SetRotationAnimated” function behaves differently in B4a and B4i?
In B4a, the content rotates around the left point, whereas in B4i it rotates around the center, which I think is correct.
Is there a way to make B4a rotate from the center as well?

Rotation= 0°
lblArrow.As(B4XView).SetRotationAnimated(300, 0)
1788245813733.png

Rotation = 180°
lblArrow.As(B4XView).SetRotationAnimated(300, 180)
1788245828370.png
 

Filippo

Expert
Licensed User
Longtime User
lblArrow.As(B4XView).SetTextAlignment("CENTER", "CENTER")

B4a:
In B4a, the arrow is aligned to the right.
1788259655946.png


B4i:
In B4i, the arrow is centered.
1788259672315.png


That's kind of weird, isn't it?
 

Attachments

  • 1788259736404.png
    1788259736404.png
    14.2 KB · Views: 14
Upvote 0

Filippo

Expert
Licensed User
Longtime User
Problem solved!
I switched the font from MaterialIcons to FontAwesome, and the problem was fixed.

Old-Code:
B4X:
    lblArrow.As(B4XView).Font = xui.CreateMaterialIcons(30)
    lblArrow.Text = Chr(0xE5C5)
New-Code:
B4X:
    lblArrow.As(B4XView).Font = xui.CreateFontAwesome(24)
    lblArrow.Text = Chr(0xF0D7)
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
Problem solved!
I switched the font from MaterialIcons to FontAwesome, and the problem was fixed.

Old-Code:
B4X:
    lblArrow.As(B4XView).Font = xui.CreateMaterialIcons(30)
    lblArrow.Text = Chr(0xE5C5)
New-Code:
B4X:
    lblArrow.As(B4XView).Font = xui.CreateFontAwesome(24)
    lblArrow.Text = Chr(0xF0D7)
i had same issues and i noticed that in b4i and b4a the font size is acting differently. in b4i a change all views in my layout with smaller font size that it acts same as in b4a.
i can use #if b4a... #else if b4i... and set a different font size
 
Upvote 0
Top