Wenn ich diesen Code auf meinem Gerät ausführen, wird unter der ImageView zusätzlicher Speicherplatz angezeigt. Am Ende möchte ich, dass meine Bilder den größten Platz auf dem Bildschirm einnehmen, ohne ihre Abmessungen zu verzerren. Jede Hilfe würde sehr geschätzt werden. Ich habe den Code für meine Elemente und ihre Attribute angehängt. Vielen Dank! So entfernen Sie unerwünschten Speicherplatz unter scrollview in Android?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_ch0_example_problems"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:clipToPadding="false"
android:fillViewport="false"
android:scrollbarStyle="insideOverlay"
tools:context="com.example.android.chsalgebra.Ch0ExampleProblems">
<Button
android:id="@+id/prevBut1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="6dp"
android:layout_marginLeft="6dp"
android:onClick="displayProblemMinus"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="Previous"
android:textAllCaps="false"
android:textColor="#769ecd" />
<Button
android:id="@+id/nextBut1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="6dp"
android:layout_marginRight="6dp"
android:onClick="displayProblemPlus"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="Next"
android:textAllCaps="false"
android:textColor="#769ecd" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/prevBut1"
android:layout_alignLeft="@+id/prevBut1"
android:layout_alignParentTop="true"
android:layout_alignStart="@+id/prevBut1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/ex1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:paddingTop="12dp"
android:scaleType="fitStart"
app:srcCompat="@drawable/ch0ex1" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
Ich kann das nicht tun, weil ich Bilder anzeige? Vielleicht verstehe ich dich falsch ... –
Ich schlage vor, um zu testen, welches Objekt programmatisch falsch ist, Bildlauf oder Bildansicht. Dieser Vorschlag dient nur zu Testzwecken. Sie können die Bildansicht nach dem Problem fix – Lenin