Android Question Determine best imageview size in custom listview based on resolution

bluedude

Well-Known Member
Licensed User
Longtime User
Hi,

I'm now setting my imagesize (.TwoLinesAndBitmap.ImageView) in a custom listview but I was wondering how I can set the best size based on resolution and scale.

Any suggestons?
 

bluedude

Well-Known Member
Licensed User
Longtime User
Erel,

A custom listview like b4amListView. I'm not setting Textsize with dip units but with normal Fontsize. Also not setting Imageview with dip because that gives weird results.

I'm using drawables from my resources and have them for different types of phones (mdpi, xxhdpi etc.), this works great for actionbar etc.

However, for the list view (i create a drawer menu with it) I never seem to be getting the best result. Best viewable result on higher resolution phones is if I set Imageview to 64.

All other options including using the scale module seem to make the icons mostly stretched and too big.

Cheers.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
TextSize shouldn't be set with dip units. However all other values should be scaled correctly.

Creating a drawer menu is quite simple with this library: jfeinstein10 SlidingMenu library

As the list is probably not too long (less then 1000 items) then you can use CustomListView class. It is much simpler than any standard ListView.
 
Upvote 0
Top