私は何か簡単だと思って苦労しています。クラスを使用して画像ボタンに画像を設定しています。私は画像が画面の拘束に合っていることを願っていますが、が伸びずにです。つまり、画面に収まらない場合は、高さを調整して、が伸びるように調整してください。高さが高すぎる場合は、画像の高さを下げて幅を狭くします。Android:画像ボタンで伸縮/スケーリングに問題がある
私はこの質問を数回尋ねましたが、私はアドバイスのすべてのビットを試しましたが、それは私のために全く違いはありません。 ImageViewの代わりにImageButtonを使用することがあると思いますか?私のクラスでここ
関連するいくつかのコードチャンクが(ひどく壊れた)です...
:
ImageView img = (ImageButton) dialog.findViewById(R.id.fullsizeimage);
img.setScaleType(ImageView.ScaleType.CENTER_INSIDE); //Changing ScaleType here has no effect
img.setImageBitmap(useThisBitmap);
そして、ここでは、XMLレイアウトの内容です...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageButton
android:id="@+id/fullsizeimage"
android:background="@null"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
/>
</RelativeLayout>
XMLファイルのその迷惑メールの中にはおそらく間違っているものがあります。しかし、私は何度もそれを変更し、それはゼロ効果を持っています。
すべてのアドバイスはです。が高く評価されています。
解決済みhttp://stackoverflow.com/questions/3318629/imagebutton-in-android/19538789#19538789 – HimalayanCoder