Question

I have used my custom images to develop several Action bar and tab icons using android icon set and use them as button backgrounds. They look fine on mobile handsets but when i test on Samsung galaxy tab 7", they feel stretched and blur.

I have tried making folders layout-sw600dp and layout-large but makes no difference.

One of the icons:

 <ImageButton
        android:id="@+id/button_settings"
        android:layout_width="64dp" 
        android:layout_height="64dp"
        android:background="@drawable/settings_custom"
        android:focusable="true"
        android:contentDescription="@string/settings"/>

settings_custom.xml:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@drawable/ic_action_app_sett" android:state_pressed="true"/>
    <item android:drawable="@drawable/ic_action_app_sett"/>

</selector>

Can anyone help me out where am I wrong? Thank you!

Was it helpful?

Solution

Try with setting android:src="@drawable/settings_custom" , for tab 7 inch you need to put images for that resolution under drawable-large-mdpi folder, please go through below link which clear more about android support for multiple screen, http://developer.android.com/guide/practices/screens_support.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top