それで、それらの画像を{*} dpiフォルダーに入れました..そうですか?すでにご存知かもしれませんが、通常の解像度 (アプリケーションに最も適した解像度 - デバイスのサイズと解像度) の画像を "mdpi" フォルダーに入れます。 xdpi) 、画像を 2.0 の比率に拡大し、デバイスが大きく高解像度 (hdpi) の場合、画像を 1.5 の比率に拡大します。また、デバイスのdpiが低くサイズが小さい場合、Androidは画像サイズを0.75の比率に絞ります。しかし、それがあなたにとって十分でない場合(私にとっては十分ではありませんでした)、単に宛先デバイスの解像度を見つけて、自分で画像のサイズを変更することができました..あなたがしなければならないことは、見つけることだけです(計算する必要があります)あなた自身のために)定数画像の解像度を調整します。例えば; 0.6 (発見された画面解像度によると、画像の幅と高さにその定数を掛けます。これが私の例です:
Display currentScreen = this.getWindowManager().getDefaultDisplay();
Point dimension = new Point();
currentScreen.getSize(dimension);
//int widthPixel = dimension.x;
int heightPixel = dimension.y;
System.out.println("Screen Resolution (Height) : "+heightPixel);
int imgHeight;
imgHeight = (int) Math.floor(heightPixel * 0.6);
int widthSeparator = (int) dimension.y/13;
System.out.println("Width Separator : "+widthSeparator);
//imgHeight = 240;
System.out.println("Image Resolution (Height) : "+imgHeight);
FrameLayout.LayoutParams layoutParamCR = new FrameLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
layoutParamCR.setMargins(widthSeparator, 0, 0, 0);
//FrameLayout.LayoutParams layoutParamL = new FrameLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
//layoutParamL.setMargins(-30, 0, 0, 0);
ImageView leftCover = (ImageView) findViewById(R.id.magCoverLeft);
leftCover.setAdjustViewBounds(true);
leftCover.setMaxHeight(imgHeight);
leftCover.setLayoutParams(layoutParamCR);
leftCover.setImageBitmap(null);
ImageView cover = (ImageView) findViewById(R.id.magCover);
cover.setAdjustViewBounds(true);
cover.setMaxHeight(imgHeight);
cover.setLayoutParams(layoutParamCR);
cover.setImageBitmap(coverImages[0]);
ImageView rightCover = (ImageView) findViewById(R.id.magCoverRight);
rightCover.setAdjustViewBounds(true);
rightCover.setMaxHeight(imgHeight);
rightCover.setLayoutParams(layoutParamCR);
rightCover.setImageBitmap(coverImages[1]);