how to place an image over another one on android app?

后端 未结 4 1489
予麋鹿
予麋鹿 2020-12-17 04:47

how i can put im2 in the correct place

FrameLayout rv =(FrameLayout)findViewById(R.id.my_ph);


    ImageView im1 = new ImageView(this);
    im1.setBackgrou         


        
4条回答
  •  时光取名叫无心
    2020-12-17 05:13

    In layout add one more ImageView and align Top, Bottom, Right, Left to first one. Make it invisible;

    
    
    
    
    

    Then in code:

    ImageView image2 =(ImageView)findViewById(R.id.image2);
    image2.setVisibility(View.VISIBLE);
    image2.setImageResource(R.drawable.my_image);
    

提交回复
热议问题