用layer-list一次加载多个层次图片

layer.xml:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">      <item android:drawable="@drawable/t">      <item android:drawable="@drawable/tt">  </layer-list>  
1.((ImageView) findViewById(R.id.imageview)).setImageDrawable(getResources().getDrawable(R.drawable.layer)); 
2.代码实现
 Resources r = getResources();      Drawable[] layers = new Drawable[2];      layers[0] = r.getDrawable(R.drawable.cor_info);      layers[1] = r.getDrawable(R.drawable.icon);      LayerDrawable layerDrawable = new LayerDrawable(layers);            ((ImageView) findViewById(R.id.imageview)).setImageDrawable(layerDrawable); 

你可能感兴趣的:(android,xml)