您的位置:首页 > 其它

imagebutton 设置了src属性的图片更换

2015-09-11 17:38 309 查看
<ImageButton
android:id="@+id/mediacontroller_play_pause"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:background="@drawable/mediacontroller_button"
android:contentDescription="@string/mediacontroller_play_pause"
android:src="@drawable/mediacontroller_pause" />

使用 更换src图片

mPauseButton.setImageResource(getResources().getIdentifier(
"mediacontroller_play", "drawable",
mContext.getPackageName()));
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: