Android Question resize panel height on runtime

phukol

Active Member
Licensed User
Longtime User
Hi guys just want to ask how can i resize a panel height during runtime? I can resize a scrollview height by using requestlayout in javaobject but when i try to use requestlayout in a panel it does not work?
 

phukol

Active Member
Licensed User
Longtime User
thnx man but its not working. I trying to readjust my customlistview and its [parent panel based on the items loaded but its not adjusting its height. ScrollView is able to adjust its height but the panel is not adjusting its height even if i set it's value
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
@phukol ... could you post some code showing attempt to resize CLV panel.
 
Upvote 0

phukol

Active Member
Licensed User
Longtime User
Thanks here is the code that loads the information based on the return string

B4X:
Sub setEventMainInfo(strInfo As String)
    Dim intA,intB,intCnt   As Int 
    Dim imgOne As String, titleOne  As String ,strDteOne As String, strLocOne As String, imgTwo As String, titleTwo As String ,strDteTwo As String, strLocTwo,strIntOne,strIntTwo As String
   
    Dim evtInfo() As String = Regex.Split("`",strInfo)
    CallSub(ImageDownloader, "ClearCache")
    CallSub(ImageDownloader, "ActivityIsPaused")
   
   
    If evtInfo.Length > 0 And strInfo.Trim.Length > 1 Then 
       
       
        pnlEventInfo2.RemoveAllViews
        pnlEventInfo2.LoadLayout("clvEventInfo")
        clvEventInfo.Clear  
        clvEventInfo.BackgroundColor(20,1)
       
        clvEventInfo.asview.Height = (evtInfo.Length * 200dip)
       
        pnlEventInfo2.Height =clvEventInfo.asview.Height + 20dip
        pnlEventInfoMain2.height =   pnlEventInfo2.Height + 400dip
   
       
        For intA = 0 To evtInfo.Length - 1
            If evtInfo(intA).Length > 0 Then   
                
               
                clvEventInfo.Add(CreateEventInfo(eventTitle2(intA),eventPhoto2(intA), eventDate2(intA),eventLoc2(intA), intA),80dip,intA)
               
            End If
        Next
       
       
        svEvent.Panel.Height = pnlEventInfoMain2.Top + pnlEventInfoMain2.Height + 90dip
       
        Dim jo As JavaObject = svEvent.Panel 'refresh scrollview height
        jo.RunMethod("requestLayout", Null)
    
       
    End If
   
    
    
End Sub
 
Upvote 0

phukol

Active Member
Licensed User
Longtime User
nope i did not set any. Even if i make a debug point or not, it does not adjust the height of the panel, only the scrollview height is adjusted.
 

Attachments

  • Untitled.png
    92.3 KB · Views: 265
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…