After scaling the image I use for my ImageButton with the Nine-patch Generator to retrieve all of the dpi files as well as maintaining the appropriate ".9" extensions, and referenced the bitmap in the src of the button, I still get the following result with the Nexus 5 virtual emulator (1080X1920, xxhdpi):
... There's no way in hell that the ImageButtons are 227X53 pixels (xxhdpi) here... But rather, the system retrieves a lower dpi like mdpi instead.
Here's the XML code for just one of the buttons:
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/demosBtn"
android:src="@drawable/demo_btn"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:background="@android:color/transparent" />
And as for the drawable resource file of the demo button:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/pressed_demo" android:state_pressed="true"/>
<item android:drawable="@drawable/norm_demo"/>
</selector>
P.S. I tried this with ImageView as well, set it as clickable, set adjustViewBounds to true, and set scaleType to centerCrop, and yet it didn't work.