3
웹에서 이미지를 가져 오는 Android 앱이 있습니다. 그러나 내가 설정 한 경우 :Android - 기기 해상도에 따라 갤러리의 이미지 크기를 조절하십시오.
<supports-screens android:anyDensity="true" />
갤러리가 지원되는 최소 해상도로 설정 될 것으로 보인다.
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout android:id="@+id/GalleryLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="#000000"
>
<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gallery"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:spacing="1dip"
android:gravity="center_vertical|center_horizontal|center"
/>
</LinearLayout>
과의 getView 클래스 :
ImageView i = new ImageView(mContext);
i.setImageDrawable(drawablesFromUrl[position]);
i.setLayoutParams(new Gallery.LayoutParams(400, 300));
i.setScaleType(ImageView.ScaleType.FIT_XY);
i.setBackgroundResource(mGalleryItemBackground);
들이 스트레칭 있도록 갤러리에 이미지 크기를 조정 한 후 사용 해상도를 감지 할 수있는 방법이 있나요 여기
갤러리 레이아웃 정의입니다 화면의 너비까지?