我为android应用程序创建了一些图片。我已经完成了创建9补丁映像所需的所有步骤,但都没有效果。应用程序不会只识别该文件。
到目前为止,我已经尝试过:
我使用的是xxhdpi图像。
下面是我用来检测9修补程序并显示它的代码:
...
Bitmap bitmap = Resources.getBitmap(context, identifier);
byte[] chunk = bitmap.getNinePatchChunk();
if (NinePatch.isNinePatchChunk(chunk)) {
drawable = new NinePatchDrawable(bitmap, chunk, new Rect(), null);
} else {
BitmapDrawable bitmapDrawable = new BitmapDrawable(bitmap);
...这是我的9补丁图像:

这是结果

关于下一步该尝试什么,我已经没有什么想法了。任何帮助都将不胜感激。
发布于 2013-11-15 06:38:02
只需设计指示灯并加以利用,不要制作整个背景..。
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/expander_open_holo_light" android:state_empty="true"></item>
<item android:drawable="@drawable/expander_close_holo_light" android:state_expanded="true"></item>
<item android:drawable="@drawable/expander_open_holo_light"></item>
</selector>苹果喜欢android:groupIndicator="@drawable/indicatornew“
https://stackoverflow.com/questions/19994801
复制相似问题