Android 프로젝트에 문제가 있습니다.RelativeLayout이있는 Android ScrollView가 작동하지 않습니다.
이미지 목록이 포함 된보기를 만들었고 Nexus 5 화면에서 모든 이미지를 볼 수 있지만 가장 작은 전화에서이 이미지 중 일부가 겹칩니다.
그래서 ScrollView를 삽입하기로 결정했지만 많은 오류가 있습니다.
많은 비슷한 질문을 발견했지만 나에게 맞는 것은 없습니다.
나를 도와 줄 사람이 있습니까? 있는 ScrollView없이
이 잘 작동 코드는 다음과 같습니다
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="none" >
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ff0088ff"
android:clickable="false">
<ImageView
android:layout_width="70dp"
android:layout_height="70dp"
android:id="@+id/imageView"
android:src="@drawable/icona_pr"
android:layout_marginLeft="28dp"
android:contentDescription="@string/icona_pr"
android:onClick="apriPreliminare"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<ImageView
android:layout_width="70dp"
android:layout_height="70dp"
android:id="@+id/imageView2"
android:src="@drawable/icona_p"
android:contentDescription="@string/icona_p"
android:onClick="apriPesantezza"
android:layout_above="@+id/imageView3"
android:layout_alignLeft="@+id/imageView"
android:layout_alignStart="@+id/imageView" />
[...]
</RelativeLayout>
</ScrollView>
안드로이드 Studio에서 내가 디자인 탭은 내가 더 긴 화면을 볼 수 미리보기를 선택
. Nexus 5에서는 잘 돌아가며 변경 사항은 없지만 Galaxy S2에서는 처음 두 ImageView가 겹칩니다.
입니다. 오류는 무엇입니까? –
나는 많은 다른 코드를 사용하여 ScrollView를 삽입하려고했는데 모든 코드가 많은 오류를 발생시킨다. 그래서 나는 내 코드로 구현하는 방법을 알고 싶다. – Gualty
첫 번째 단계는 시도한 것을 보여주는 것입니다 (작동하지 않더라도). 두 번째 단계는 오류가 실제로 말하고 어디서 오는 것인지 알려주는 것입니다. IDE 오류입니까? 그것은 컴파일합니까? logcat에서 볼 수있는 런타임 오류입니까? –