私はsplash.pngを持っていて、fitXY
のように画面上のすべての場所にこの画像が表示されるようにImageView
にしてください。 splash.pngのサイズは480x767です。イメージのサイズを設定するには?
コードで変更する必要があるものは何ですか?
public class BitmapConfigView extends LinearLayout {
private Bitmap mImage;
private Paint mPaint = new Paint();
public BitmapConfigView(Context context) {
super(context);
BitmapFactory.Options opts = new BitmapFactory.Options();
opts.inPreferredConfig = Bitmap.Config.ARGB_8888;
opts.inScaled = false;
mImage = BitmapFactory.decodeResource(getResources(), R.drawable.splash, opts);
mPaint.setDither(true);
setWillNotDraw(false);
setOrientation(VERTICAL);
setGravity(Gravity.BOTTOM);
}
@Override
protected void onDraw(Canvas canvas) {
canvas.drawBitmap(mImage, 0.0f, 0.0f, mPaint);
}
}
あなたはどのようなアプローチを試みましたか?どのような問題がありましたか? –
私は[リンク](http://stackoverflow.com/questions/8563370/how-to-apply-rgba-8888-and-dither-correctly/8563452#8563452)をさまざまな方法で決定しようとしています。この質問のコードは私に優れたイメージを与えますが、サイズが間違っています。 – Sviatoslav