سؤال

I'm developing an app in Android, and since I'm using a dark background, the checkboxes are not visible so I need to use a drawable, I have created a 45 x 45 px image, if I test it in a Nexus 5, the image looks big, and it looks bigger in a lower resolution phone, this is the output:

[1]: http://i.imgur.com/isUuYOp.png

What's the recommended size for a drawable checkbox? how can I fit it accordingly to different resolutiones? thank you!

EDIT:

Thanks to the suggestions I ended up using a 9patch image, however, I want to double check if my assumption is correct, since I need to resize the whole checkbox, the boundaries should be on the edges of the images right? I'm not selecting the transparent area:

enter image description here

Would that be ok? I already tested it in a Nexus 5 and in an emulator (320 x 480), and it looks ok, just double checking, thanks!

هل كانت مفيدة؟

المحلول

Here is information about sizes in Android: http://developer.android.com/design/style/metrics-grids.html

So good size is about 32dp for CheckBox and you can make the image 9-patch. So minimum pixel size gets automatically scaled to fit and look good.

For pixel sizes check this: http://developer.android.com/design/style/iconography.html

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top