뷰의 맨 위에 이미지 뷰가있는 뷰를 만듭니다. 이미지 크기는 1080-800 픽셀입니다. HTC One을 살펴 본다면 완벽합니다. 이미지 너비는 전체 화면을 차지합니다. 더 크거나 더 짧은 다른 장치를 가져 가면 이미지가 작거나 커집니다! drawable-xxhdpi 폴더에 이미지를 저장합니다. 포토샵으로 크기를 다르게 조정해야합니까?이미지 뷰를 다른 장치로 확대
당신이 볼 수있는, 왼쪽의 크기는 내가 오른쪽에 하나 같이 큰 장치를 처리 할 수있는 방법 PERFEKT, 그러나?
코드 :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/layout">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Crunch"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<HorizontalScrollView
android:id="@+id/horizontalScrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/crunch1" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/crunch2" />
</LinearLayout>
</HorizontalScrollView>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/crunch" />
<TextView
android:id="@+id/TVTimer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<Button
android:id="@+id/pause"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:onClick="verlaufKlick"
android:text="@string/pause"
android:visibility="invisible"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
나는 @ 결합이 대답을 생각한다 wael의 대답이 최선의 선택입니다 - Wael의 대답은 좋은 이미지입니다. 크기가 큰 버전 (OOM 오류가 발생할 수 있음) 만 사용하려면 메모리에 큰 이미지를 가져 오지 않을 것이고 TheOsirian의 대답은 이미지가 화면의 전체 너비로 표시되고 바둑판 식으로 배열되지 않음 – panini
이 두 이미지 -보기에 추가하지만, 아무런 변화가 없습니다. – basti12354
아마도 'android : scaleType = "centerInside"를 설정해야 할 것입니다. – TheOsirian