Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ImageView中的图像不';t完全适合android_Android_Imageview_Zooming - Fatal编程技术网

ImageView中的图像不';t完全适合android

ImageView中的图像不';t完全适合android,android,imageview,zooming,Android,Imageview,Zooming,我正在使用一个自定义的Imageview库进行缩放和双击 我为Imageview设置了一个高分辨率图像(2263 x 3468),但它不能完全适应它 上部和下部有一些空白(高度未完全调整) 我尝试了所有可用的选项,包括(fitXY、matrix、centreCrop等),但都没有效果 <it.sephiroth.android.library.imagezoom.ImageViewTouch android:id="@+id/imageView1" andr

我正在使用一个自定义的Imageview库进行缩放和双击

我为Imageview设置了一个高分辨率图像(2263 x 3468),但它不能完全适应它

上部和下部有一些空白(高度未完全调整)

我尝试了所有可用的选项,包括(fitXY、matrix、centreCrop等),但都没有效果

<it.sephiroth.android.library.imagezoom.ImageViewTouch
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/lay_next"
        android:adjustViewBounds="true"
        android:scaleType="fitXY"/>

尝试使用
ImageView
查看问题是源于代码还是源于库。setDisplayType(DisplayType.FIT_to_屏幕)。
public class SplashScreen extends Activity{

    Intent intent_menu;
    Matrix imageMatrix;

    @Override
    public void onCreate(Bundle savedInstanceState) {


        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);

            setContentView(R.layout.splashscreen);


            ImageViewTouch mImage = (ImageViewTouch) findViewById(R.id.imageView1);
            mImage.setDisplayType(DisplayType.FIT_TO_SCREEN);

            mImage.setSingleTapListener(new OnImageViewTouchSingleTapListener() {


                public void onSingleTapConfirmed() {

                }
            });

            mImage.setDoubleTapListener(new OnImageViewTouchDoubleTapListener() {


                public void onDoubleTap() {

                }
            });

            mImage.setOnDrawableChangedListener(new OnDrawableChangeListener() {


                public void onDrawableChanged(Drawable drawable) {

                }
            });

            //mImage.setBackgroundResource(R.drawable.poster);
            if( null == imageMatrix ) {
                imageMatrix = new Matrix();
            } else {
                // get the current image matrix, if we want restore the 
                // previous matrix once the bitmap is changed
                // imageMatrix = mImage.getDisplayMatrix();
            }
            Bitmap imgs = BitmapFactory.decodeResource(getResources(),R.drawable.poster);
            mImage.setImageDrawable(null);
            //mImage.setBackgroundResource(imgs, imageMatrix.isIdentity() ? null : imageMatrix, ImageViewTouchBase.ZOOM_INVALID, ImageViewTouchBase.ZOOM_INVALID);
            mImage.setImageBitmap( imgs, imageMatrix.isIdentity() ? null : imageMatrix, ImageViewTouchBase.ZOOM_INVALID, ImageViewTouchBase.ZOOM_INVALID );     

        }

}