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

Discussion in 'Android Questions' started by KMatle, Feb 25, 2017.

  1. KMatle

    KMatle Expert Licensed User

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

    Code:
    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)
    Code:
    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?
     
  2. LucaMs

    LucaMs Expert Licensed User

  3. KMatle

    KMatle Expert Licensed 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)
     
  4. LucaMs

    LucaMs Expert Licensed 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:
    Code:
    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%x075%x75%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: Feb 25, 2017
    KMatle likes this.
  5. KMatle

    KMatle Expert Licensed User

    It's a general error. Erel is working on that issue. Workarround: Just drag your file directly into the threat's window (where you write the text).
     
    LucaMs likes this.
  6. Erel

    Erel Administrator Staff Member Licensed User

    All that I can say is that it is indeed a standard view and the rotation and content drawing are handled by the OS.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice