Ich habe eine Aktivität mit diesem Layout:In einem Fragment, wenn ein Bild als Hintergrund eines RelativeLayout in Scrollview gesetzt ist, wird die RelativeLayout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.MainActivity" />
Dann dieses Fragment Layout Ich habe, was ich bin in der fragment_container der Aktivität Transaktionen:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:id="@+id/relative_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_login">
</RelativeLayout>
</ScrollView>
die ziehbar bg_login ist: Aber das merkwürdige, was geschieht ist, versteckt sich das Hintergrundbild (bg_login) alle Inhalte in RelativeLayout, im Vorschaufenster sowie als wh de Ich betreibe die App. Ich kann nicht herausfinden, warum das passiert! Bitte helfen Sie.
Versuchen Sie, Hintergrund zur Bildansicht hinzuzufügen und setzen Sie relativ dazu mit Rahmen-Layout – g7pro