German Höhe in Laufzeit verändern

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Hallo,

ich erstelle mit dem AccordionPanel Lib einen Accordionviewer wie folgt
Diese befindet sich in Sub Activity_Create(FirstTime As Boolean)

B4X:
accord.addPanel(41dip, 270dip, createPanel("User Login", 41dip, 270dip, Colors.ARGB(255,255,255,255),0))
    accord.addPanel(41dip, 350dip, createPanel("Network TCP/IP", 41dip, 350dip, Colors.ARGB(255,255,255,255),1))
    accord.addPanel(41dip, 360dip, createPanel("Device Network", 41dip, 360dip,Colors.ARGB(255,255,255,255),2))
    accord.addPanel(41dip, 250dip, createPanel("Timeout / Watchdog", 41dip, 250dip,Colors.ARGB(255,255,255,255),3))
    accord.addPanel(41dip, 250dip, createPanel("Set name & inching modus of OUTPUT", 41dip, 250dip,Colors.ARGB(255,255,255,255),4))
    accord.addPanel(41dip, 250dip, createPanel("Set name of INPUT", 41dip, 250dip,Colors.ARGB(255,255,255,255),5))
    accord.addPanel(41dip, 250dip, createPanel("Notification", 41dip, 250dip,Colors.ARGB(255,255,255,255),6))
    accord.addPanel(41dip, 480dip, createPanel("APP Information", 41dip, 480dip,Colors.ARGB(255,255,255,255),7))
    accord.addPanel(41dip, 300dip, createPanel("QRcode Reader for Login data", 41dip,3000dip,Colors.ARGB(255,255,255,255),8))

soweit alles gut.

Die Sub für den CreatePanel schaut so aus?
B4X:
Sub createPanel(text As String, Width As Int, Height As Int,color As Int, Index As Int) As Panel
      
    Dim p As Panel
    p.Initialize("")
    p.Width = Width            'KC
    p.Height = Height        'KC
    p.Color=Colors.ARGB(255,152,191,0)
  
    Dim l As Label
    l.Initialize("")
    l.Text = text
    l.Typeface = Typeface.LoadFromAssets("opensans-regular.ttf")
    l.TextColor=Colors.White
    l.Gravity = Bit.Or(Gravity.LEFT, Gravity.CENTER_VERTICAL)
  
    p.AddView(l,5dip,0,100%x,40dip)
  
  
    Dim cont As Panel
    cont.Initialize("")
    cont.Color=color
  
    p.AddView(cont,0, 40dip,100%x, 100%y+280dip) ' for example    'KC

  
    Select Index
        Case 0
            cont.LoadLayout("Accordion_Login")

        Case 1
            cont.LoadLayout("Accordion_Network_Setting")
        Case 2
            cont.LoadLayout("Accordion_Device_IP_Setting")
        Case 3
            cont.LoadLayout("Accordion_HW_Reset_WD")
        Case 4
            cont.LoadLayout("Accordion_Set_Output_Name")
        Case 5
            cont.LoadLayout("Accordion_Set_Input_Name")
        Case 6
            cont.LoadLayout("Accordion_Notification_Setting")
        Case 7
            cont.LoadLayout("Accordion_App_Info")
        Case 8
            cont.LoadLayout("CameraPage")
    End Select
  
    'p.AddView(cont,0,40dip,100%x,100%y+280dip) ' for example
      
    p.Tag = Index
    Return p
End Sub

Nun möchte ich aber dessen
closedHeight As Int, expandedHeight As Int,
zur Laufzeit verändern.

Kann mir einer zeigen, wo genau ich das tun kann?

Vielen Dank im Voraus
Sinan
 
Last edited:
Top