Android 设置ImageView源无法正常工作

Android 设置ImageView源无法正常工作,android,android-imageview,Android,Android Imageview,按下停止播放按钮时,我正在将新图像加载到imageview中。它们来回切换。然而,当我在我的代码中设置图像源时,它似乎真的错了 以前 然后我打电话 bottomBar.setImageResource(R.drawable.bottombuttonsstop); 最终结果 布局XML <LinearLayout android:id="@+id/bottomBarBox" android:layout_width="fill_parent" android:l

按下停止播放按钮时,我正在将新图像加载到imageview中。它们来回切换。然而,当我在我的代码中设置图像源时,它似乎真的错了

以前

然后我打电话

bottomBar.setImageResource(R.drawable.bottombuttonsstop);
最终结果

布局XML

<LinearLayout
    android:id="@+id/bottomBarBox"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true" >
    <ImageView
        android:id="@+id/bottomBar"
        android:layout_width="match_parent"
        android:background="@drawable/bottombuttons"
        android:layout_height="wrap_content" />
</LinearLayout>


显然,由于某些原因,无法正确加载,有什么想法吗?

尝试调用
setBackgroundResource
,而不是
setImageResource
或在布局文件中设置
android:src