0
私はandroid:theme="@android:style/Theme.Dialog"
を使用するアクティビティを持っています。アクティビティには、異なる次元の画像を表示できるImageViewが含まれています。 ImageViewは、少なくとも軸に完全にフィットし、元のアスペクト比を維持するように、ウィンドウに完全に収まるように画像を拡大縮小する必要があります。ダイアログのサイズは、ImageViewと同じ大きさでなければなりません(境界線の幅に加えて)。ダイアログスタイルのアクティビティでイメージを最大サイズに拡大する方法
私は次のことを試してみましたが、ダイアログウィンドウは、常に全体の利用可能なスペースを使用しています。
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/imageParent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dip">
<ProgressBar
android:id="@android:id/progress"
android:layout_width="40dip"
android:layout_height="40dip"
android:layout_centerInParent="true"
android:visibility="gone"
style="@android:attr/progressBarStyleSmallTitle"/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:id="@+id/image"/>
</RelativeLayout>