How can I make an ImageView appear in the middle of the screen when the user clicks a button? I have placed the image in the res/drawable-folder.
I've been trying with the code below but I don't know how to make the ImageView appear:
View v = new ImageView(getBaseContext());
ImageView image;
image = new ImageView(v.getContext());
image.setImageDrawable(v.getResources().getDrawable(R.drawable.gameover));
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…