0

を誤動作されている私は、このレイアウトで活性を有します描画可能bg_loginがある、RelativeLayoutは

<?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> 

:活動のfragment_containerで取引することはbg_login しかし、何が起こっている奇妙なことがあり、背景画像(bg_login)もプレビューペインで、RelativeLayout内のすべてのコンテンツを非表示にしますwhとして私はアプリを実行します。なぜこれが起こっているのか分かりません!助けてください。

+0

試しフレームレイアウトを使用して、それ以上のイメージビューの背景と設定された相対を追加 – g7pro

答えて

0

私はあなたがやりたいことを知っていません。スクロールするかしないときに、相対的なレイアウトに複数の背景が必要ですか? しかし、私はあなたを想定して、スクロールビューは、バックグラウンドの子要素を持つときはベストプラクティスではありません。 したがって、scollビューは親からの子に設定されていなければなりません。 これはあなたを助けることができることがあります。

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
android:background="@drawable/bg_login"> 
<ScrollView 
    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"> 


    </RelativeLayout> 

</ScrollView> 
</RelativeLayout>