Android Question Scrollview rotate x-axis: Content doesn't show

KMatle

Expert
Licensed User
Longtime User
I've rotated a Scrollview (with a simple label on the SV's panel) to do a Starwars text scroll effect:

B4X:
SV.Initialize(1000dip)
    Activity.AddView(SV,0,0,100%x,100%y)
    BigLabel.Initialize("")
    BigLabel.Text="Long text....."
    SV.Panel.AddView(BigLabel,0,0,100%x,300%y)
    SetLabelTextSize(BigLabel,BigLabel.Text,70,50)
    BigLabel.Textcolor=Colors.Yellow
    SV.Panel.Height=BigLabel.Height
    setRotationX(SV,30)

B4X:
Sub setRotationX(v As View, Angle As Float)
    Dim jo = v As JavaObject
    jo.RunMethod("setRotationX", Array As Object(Angle))
End Sub

The text is shown but when I start to scroll, it is hidden until I scroll down to the end. Invalidate doesn't help here. Any ideas?
 

KMatle

Expert
Licensed User
Longtime User
Thank's Lucas, but i'm not 100% satisfied with this answer :)

The question was not "is there a nice lib to do that", it was "why does a standard view not work as expected" (I assume that a Scrollview is a standard view, so it's nothing special)
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
I tried to upload a project but I got a dialog which informed me that I have not the permission :eek:


Try this code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   'Activity.LoadLayout("Layout1")

   SV.Initialize(1000dip)
   Activity.AddView(SV, 12.5%x, 0, 75%x, 75%y)
   SV.Panel.Height= SV.Height
   SV.Panel.Color = Colors.Yellow

   Dim BigLabelHeight As Int = 50dip
   BigLabel.Initialize("")
   BigLabel.Text="Long text....."
   SV.Panel.AddView(BigLabel, 10dip, SV.Panel.Height - BigLabelHeight, SV.Panel.Width - 10dip, BigLabelHeight)
   BigLabel.Textcolor=Colors.Yellow
   BigLabel.TextSize = 30
   BigLabel.TextColor = Colors.Black

   setRotationX(SV,30)
End Sub
 
Last edited:
Upvote 0
Top