Reputation: 2239
I am loading a new image into an imageview when the stop and play button is pressed. They toggle back and forth. However when I set the image source in my code is appears really wrong.
Before
Then I call
bottomBar.setImageResource(R.drawable.bottombuttonsstop);
End Result
Layout 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>
Obviously this is not loading correctly for some reason, any ideas?
Upvotes: 0
Views: 280
Reputation: 562
Try to call setBackgroundResource
instead of setImageResource
or set android:src
in a layout file
Upvotes: 1