0

すでに入っている画像を拡大する方法を知りたいImageViewです。

私はこれを持っています:

m_imageView.setImageBitmap(imagen); 
int newHeight = getWindowManager().getDefaultDisplay().getHeight() / 2;
int orgWidth = m_imageView.getDrawable().getIntrinsicWidth();
int orgHeight = m_imageView.getDrawable().getIntrinsicWidth();
int newWidth = (int) Math.floor((orgWidth * newHeight) / orgHeight);
//Use RelativeLayout.LayoutParams if your parent is a RelativeLayout
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                newWidth, newHeight);
m_imageView.setLayoutParams(params);
//m_imageView.setScaleType(ImageView.ScaleType.FIT_START);

しかし、それは何もしません、イメージは同じままです。

ご協力ありがとうございました。

4

1 に答える 1

1

ビューを無効にしましたか?あなたのアクティビティにinvalidate()またはpostInvalidate()を使用していますか?

于 2012-07-26T22:28:20.740 に答える