Get position of ImageView relative to screen programmatically

后端 未结 3 1542
猫巷女王i
猫巷女王i 2020-12-29 08:14

I want to get the position of my ImageView programmatically. By position, I mean the distance in pixel from top of the screen to that ImageView. I

3条回答
  •  再見小時候
    2020-12-29 08:56

    Glide.with(this)
                    .asBitmap()
                    .apply(requestOptions)
                    .load(url)
                    .placeholder(R.mipmap.img_place_holder)
                    .apply(new RequestOptions().override(myImage.getMeasuredWidth(), myImage.getMeasuredHeight()))
                    .into(new SimpleTarget() {
                        @Override
                        public void onResourceReady(Bitmap bitmap,
                                                    Transition transition) {
    
    //                        TouchImageView   myImage1 = findViewById(R.id.image_zoom_poll_card);
                            img_zoomIn.setVisibility(View.VISIBLE);
    
                            myImage.setImageBitmap(bitmap);
    
            getBitmapPositionInsideImageView(myImage, img_zoomIn);
    
                        }
                    });
    

提交回复
热议问题