网上很多文章都说.9图放在drawable下,其实这种说法是错误的!!!

开发中一般都是设计切好.png图,开发者使用Android Studio Creat 9-patch file来生成.9.png后缀的.9图

具体.9图应该放在哪一个文件夹,取决于设计切的是几倍的图,

1倍图,放在drawable或者drawable-mdpi

2倍图,放在drawable-xdpi

3倍图,放在drawable-xxdpi

以此类推,对应放置。

网上普遍所说的放在drawable目录下,可能默认.9都是切的1倍图。

此外:drawable默认是1倍,同一张图片,放置在drawable和drawable-mdpi效果是一样的。

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/d_normal"/>

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/d_normal_l"/>

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/d_normal_m"/>

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/d_normal_h"/>

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/d_normal_xx"/>

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/d_normal_no"/>

同一张图片放置在不同drawable下