A ASanchez New Member Licensed User Longtime User Aug 9, 2013 #1 Hello: Been around this forum for a little while, first I want to thank to all members, for i've learned a lot from reading your posts. Now, the question that finally pushed me to write: I have a project that make use of a ListView, as per Contacts Search example. I want to resize the embedded scrollview to match the screen with or without the virtual keyboard showing. I have added the view with sv.AddToParent(Activity, 0, 0, 95%x, 80%y) and tried to resize it with sv.height at no avail. Is there a way to do it?
Hello: Been around this forum for a little while, first I want to thank to all members, for i've learned a lot from reading your posts. Now, the question that finally pushed me to write: I have a project that make use of a ListView, as per Contacts Search example. I want to resize the embedded scrollview to match the screen with or without the virtual keyboard showing. I have added the view with sv.AddToParent(Activity, 0, 0, 95%x, 80%y) and tried to resize it with sv.height at no avail. Is there a way to do it?
T thader2012 Member Licensed User Longtime User Aug 9, 2013 #2 Hi, I understand that you use un LISTVIEW. Add ListView with name PEPE for example is Code: Activity.AddView(PEPE,left,Top, Width, Height) There, you say the heigth of the listview You can change the height using Code: PEPE.height= 100dip where 100dip is the new dimension Upvote 0
Hi, I understand that you use un LISTVIEW. Add ListView with name PEPE for example is Code: Activity.AddView(PEPE,left,Top, Width, Height) There, you say the heigth of the listview You can change the height using Code: PEPE.height= 100dip where 100dip is the new dimension
A ASanchez New Member Licensed User Longtime User Aug 9, 2013 #3 Hi Thader. I'm really sorry, I asked for help on a ListView while I'm using a SearchView.. :S As for your response, Thats exactly what I'm trying to do, except than SearchView doesnt accept .height Upvote 0
Hi Thader. I'm really sorry, I asked for help on a ListView while I'm using a SearchView.. :S As for your response, Thats exactly what I'm trying to do, except than SearchView doesnt accept .height
M Mahares Expert Licensed User Longtime User Aug 10, 2013 #4 You can add a panel to the activity and then add the searchview to the panel and change the panel height that way. Code: Dim sv As SearchView Dim MyPanel As Panel MyPanel.Initialize("") Activity.AddView(MyPanel,0,0,95%x,80%y) MyPanel.Color=Colors.Cyan sv.Initialize(Me, "sv") sv.AddToParent(MyPanel, 0, 0, 60%x, 60%y) Upvote 0
You can add a panel to the activity and then add the searchview to the panel and change the panel height that way. Code: Dim sv As SearchView Dim MyPanel As Panel MyPanel.Initialize("") Activity.AddView(MyPanel,0,0,95%x,80%y) MyPanel.Color=Colors.Cyan sv.Initialize(Me, "sv") sv.AddToParent(MyPanel, 0, 0, 60%x, 60%y)
Erel B4X founder Staff member Licensed User Longtime User Aug 11, 2013 #5 SearchView is based on ListView. Open the SearchView module and change the ListView height. Upvote 0
A ASanchez New Member Licensed User Longtime User Aug 13, 2013 #6 Thank you very much for your answers. I kind of mixed your solutions, embedding a searchview in a panel and in IME_HeightChanged this code: Code: pnl.Height= NewHeight*0.80 sv.HeightChanged (pnl.Height ) In ListView module code I added: Code: Public Sub HeightChanged(NewHeight As Int ) lv.Height = NewHeight-et.Height End Sub Upvote 0
Thank you very much for your answers. I kind of mixed your solutions, embedding a searchview in a panel and in IME_HeightChanged this code: Code: pnl.Height= NewHeight*0.80 sv.HeightChanged (pnl.Height ) In ListView module code I added: Code: Public Sub HeightChanged(NewHeight As Int ) lv.Height = NewHeight-et.Height End Sub