R ronovar Active Member Licensed User Longtime User Jun 2, 2016 #1 I have used ListView with AddTwoLinesAndBitmap2 and this works fine...now i get into problem that ListView Height is not same on all devices...i try to use xml layout for listview but i get error in B4A when i try to use AddTwoLinesAndBitmap2. I define ListView this way: Code: Copy 'GET - Panels pnlVideoClubList = Xml.GetView("pnlVideoClubList") 'ADDVIEW - lvVideoClubList pnlVideoClubList.AddView(lvVideoClubList, 0, 0, pnlVideoClubList.Width, pnlVideoClubList.Height) And pnlVideoClubList is defined in XML this way: Code: Copy <RelativeLayout android:id="@+id/VideoClubList" android:layout_width="598dp" android:layout_height="532dp" android:layout_centerVertical="true" android:layout_marginLeft="73dp" > <Panel android:id="@+id/pnlVideoClubList" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </RelativeLayout> So i have 14 items witch one item height is 38dip so 14 items x 38dip = 532dp and on one android box (MyGica) ListView is correct and on other android box (MX III) ListView is showing 14 items and one half item.... how to fill listview to panel pnlVideoClubList so that ListView will be same on all devices? Or any other idea?
I have used ListView with AddTwoLinesAndBitmap2 and this works fine...now i get into problem that ListView Height is not same on all devices...i try to use xml layout for listview but i get error in B4A when i try to use AddTwoLinesAndBitmap2. I define ListView this way: Code: Copy 'GET - Panels pnlVideoClubList = Xml.GetView("pnlVideoClubList") 'ADDVIEW - lvVideoClubList pnlVideoClubList.AddView(lvVideoClubList, 0, 0, pnlVideoClubList.Width, pnlVideoClubList.Height) And pnlVideoClubList is defined in XML this way: Code: Copy <RelativeLayout android:id="@+id/VideoClubList" android:layout_width="598dp" android:layout_height="532dp" android:layout_centerVertical="true" android:layout_marginLeft="73dp" > <Panel android:id="@+id/pnlVideoClubList" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </RelativeLayout> So i have 14 items witch one item height is 38dip so 14 items x 38dip = 532dp and on one android box (MyGica) ListView is correct and on other android box (MX III) ListView is showing 14 items and one half item.... how to fill listview to panel pnlVideoClubList so that ListView will be same on all devices? Or any other idea?
R ronovar Active Member Licensed User Longtime User Jun 2, 2016 #2 Thanks..for solution i try it and on seconde android box there is visible 14items and half...so solution does not work. Upvote 0
Thanks..for solution i try it and on seconde android box there is visible 14items and half...so solution does not work.
LucaMs Expert Licensed User Longtime User Jun 3, 2016 #3 If you want "same size" (fixed size) of ListView and ListView Items on all devices you must set their size in dip (so your ListView can be 3cm height on all devices, for example). If you want they have the same proportions you must use percentages (lvVideoClub.Height = 75%y) Upvote 0
If you want "same size" (fixed size) of ListView and ListView Items on all devices you must set their size in dip (so your ListView can be 3cm height on all devices, for example). If you want they have the same proportions you must use percentages (lvVideoClub.Height = 75%y)
Erel B4X founder Staff member Licensed User Longtime User Jun 5, 2016 #4 How many items are there in the list? Upvote 0
LucaMs Expert Licensed User Longtime User Jun 5, 2016 #5 ronovar said: is showing 14 items and one half item Click to expand... I don't think that showing half item is bad; indeed, this way I know that items are not only those displayed and I must scroll them. Upvote 0
ronovar said: is showing 14 items and one half item Click to expand... I don't think that showing half item is bad; indeed, this way I know that items are not only those displayed and I must scroll them.
R ronovar Active Member Licensed User Longtime User Jun 5, 2016 #6 There are 14 items per page...total 358 items in listview Upvote 0
LucaMs Expert Licensed User Longtime User Jun 5, 2016 #7 ronovar said: There are 14 items per page...total 358 items in listview Click to expand... I don't think it is essential. If you want a fixed number of items visible on all devices, you should use percentages to set sizes (panel, listview and items) and, at least, functions like Min and Max. Just study a little Upvote 0
ronovar said: There are 14 items per page...total 358 items in listview Click to expand... I don't think it is essential. If you want a fixed number of items visible on all devices, you should use percentages to set sizes (panel, listview and items) and, at least, functions like Min and Max. Just study a little
Erel B4X founder Staff member Licensed User Longtime User Jun 5, 2016 #8 ronovar said: There are 14 items per page...total 358 items in listview Click to expand... You can use CustomListView to implement such a list. It will be simple. https://www.b4x.com/android/forum/t...xible-list-based-on-scrollview.19567/#content Upvote 0
ronovar said: There are 14 items per page...total 358 items in listview Click to expand... You can use CustomListView to implement such a list. It will be simple. https://www.b4x.com/android/forum/t...xible-list-based-on-scrollview.19567/#content
LucaMs Expert Licensed User Longtime User Jun 5, 2016 #9 Erel said: You can use CustomListView to implement such a list. It will be simple. https://www.b4x.com/android/forum/t...xible-list-based-on-scrollview.19567/#content Click to expand... I love CustomListView but I fear the problem is the same (items and view height). Upvote 0
Erel said: You can use CustomListView to implement such a list. It will be simple. https://www.b4x.com/android/forum/t...xible-list-based-on-scrollview.19567/#content Click to expand... I love CustomListView but I fear the problem is the same (items and view height).
R ronovar Active Member Licensed User Longtime User Jun 5, 2016 #10 I wil try with width and height for example 40%x and 80%y and replay results... strange is that i could not use in B4A xml defined width and height like parent_fill (inside panel) so that way will listview expand to panel size.... Upvote 0
I wil try with width and height for example 40%x and 80%y and replay results... strange is that i could not use in B4A xml defined width and height like parent_fill (inside panel) so that way will listview expand to panel size....