Slide 33
Slide 33 text
Labeling UI Elements - 動的
if (mediaCurrentlyPlaying) {
playPauseImageView.setImageResource(R.drawable.ic_pause);
// In res/values/strings.xml, "pause" contains a value of "Pause".
playPauseImageView.setContentDescription(getString(R.string.pause));
} else {
playPauseImageView.setImageResource(R.drawable.ic_play);
// In res/values/strings.xml, "play" contains a value of "Play".
playPauseImageView.setContentDescription(getString(R.string.play));
}
“pause”
“play”
33