W wl Well-Known Member Licensed User Longtime User Sep 2, 2013 #1 Hi, In my app I was using the Listview (AddTwoTextBoxesAndBitmap2): it seemed great on both my Phone as my tablet, but it lacked the possibility to cope with long texts. Therefore I started to use the CustomListView, but here I run into trouble while displaying the two labels one below the other: Code: Copy result.AddView(iv, 5, 10, 40, 40) result.AddView (lbl1, 60, 5, textWidth, 14) 'Text height of label 14 result.AddView(lbl2, 60, 5 + 16, textWidth, 12) 'Tekst height of label 12 On my tablet the texts are one below the other, but on my Phone texts overlap. How can I deal with this ? What's the reason ? Thanks
Hi, In my app I was using the Listview (AddTwoTextBoxesAndBitmap2): it seemed great on both my Phone as my tablet, but it lacked the possibility to cope with long texts. Therefore I started to use the CustomListView, but here I run into trouble while displaying the two labels one below the other: Code: Copy result.AddView(iv, 5, 10, 40, 40) result.AddView (lbl1, 60, 5, textWidth, 14) 'Text height of label 14 result.AddView(lbl2, 60, 5 + 16, textWidth, 12) 'Tekst height of label 12 On my tablet the texts are one below the other, but on my Phone texts overlap. How can I deal with this ? What's the reason ? Thanks
Erel B4X founder Staff member Licensed User Longtime User Sep 3, 2013 #2 See this tutorial: Supporting multiple screens - tips and best practices Upvote 0
W wl Well-Known Member Licensed User Longtime User Sep 3, 2013 #3 thanks Erel, I will need to reread the tutorial. But still I find it strange that when I used absolute positions and the same font on 1 device the tekst overlaps and on the other there is plenty of room between the labels Upvote 0
thanks Erel, I will need to reread the tutorial. But still I find it strange that when I used absolute positions and the same font on 1 device the tekst overlaps and on the other there is plenty of room between the labels
klaus Expert Licensed User Longtime User Sep 3, 2013 #4 Can you post a small example project showing the problem ? Best regards. Upvote 0
nfordbscndrd Well-Known Member Licensed User Longtime User Sep 3, 2013 #5 wl said: thanks Erel, I will need to reread the tutorial. But still I find it strange that when I used absolute positions and the same font on 1 device the tekst overlaps and on the other there is plenty of room between the labels Click to expand... Have you looked at this: http://www.b4x.com/android/wiki/index.php/Designer#Introduction ? It explains why text looks different on different size devices such as a phone and a tablet. Upvote 0
wl said: thanks Erel, I will need to reread the tutorial. But still I find it strange that when I used absolute positions and the same font on 1 device the tekst overlaps and on the other there is plenty of room between the labels Click to expand... Have you looked at this: http://www.b4x.com/android/wiki/index.php/Designer#Introduction ? It explains why text looks different on different size devices such as a phone and a tablet.
Erel B4X founder Staff member Licensed User Longtime User Sep 4, 2013 #6 The code you posted is wrong. If you are using v2.7 then you should see a list of warnings about it. You should never set pixel values without 'dip' unit. Upvote 0
The code you posted is wrong. If you are using v2.7 then you should see a list of warnings about it. You should never set pixel values without 'dip' unit.
W wl Well-Known Member Licensed User Longtime User Sep 5, 2013 #7 Thanks nfordbscndrd and thanks Erel: I will have a look at it ! Thanks Klaus: while peparing a demo I had a look in the code of the customlistview, and I think I figured it out. I attached the demo. Attachments customlistview demo.zip customlistview demo.zip 4.6 KB · Views: 407 Last edited: Sep 5, 2013 Upvote 0
Thanks nfordbscndrd and thanks Erel: I will have a look at it ! Thanks Klaus: while peparing a demo I had a look in the code of the customlistview, and I think I figured it out. I attached the demo.