0

我有一个活动xml中的协调员布局和一个包含内容布局xml的包含布局。就像这样:内容布局xml双高度尺寸内NestedScrollView

<android.support.design.widget.CoordinatorLayout 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:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fitsSystemWindows="true" 
android:id="@+id/main"> 

<android.support.v4.widget.NestedScrollView 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

<include layout="@layout/content_sign_in" /> 

</android.support.v4.widget.NestedScrollView> 

当我把我的内容布局的nestedscrollview我的内容布局增加一倍,你heigth内。任何人都可以帮助我?

我的内容布局的xml:

<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/content_sign_in" 
android:layout_width="match_parent" 
android:background="@drawable/sign_up_bg" 
android:layout_height="match_parent" 
tools:showIn="@layout/activity_sign_in"> 

<ImageButton 
    android:id="@+id/arrow_back" 
    android:layout_marginTop="15dp" 
    android:layout_marginLeft="10dp" 
    android:scaleType="centerInside" 
    android:padding="5dp" 
    android:src="@drawable/ic_back_white" 
    android:background="@android:color/transparent" 
    android:layout_width="40dp" 
    android:layout_height="40dp" /> 

<ImageView 
    android:scaleType="centerInside" 
    android:layout_below="@+id/arrow_back" 
    android:id="@+id/logo" 
    android:layout_marginTop="6dp" 
    android:layout_centerHorizontal="true" 
    android:layout_width="78dp" 
    android:layout_height="45dp" /> 

<android.support.design.widget.TextInputLayout 
    android:textColorHint="@color/color_80ffffff" 
    android:id="@+id/input_layout_email" 
    android:layout_marginLeft="46dp" 
    android:hint=" " 
    android:layout_marginRight="46dp" 
    android:layout_marginTop="74dp" 
    android:layout_below="@+id/logo" 
    app:errorTextAppearance="@style/error_appearance" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

<android.support.v7.widget.AppCompatEditText 
    android:id="@+id/work_email" 
    android:gravity="center" 
    android:theme="@style/EditTextLogin" 
    android:textColorHint="@color/color_80ffffff" 
    android:hint="@string/hint_work_email" 
    android:textColor="@android:color/white" 
    android:textSize="14sp" 
    android:inputType="textEmailAddress" 
    android:imeOptions="actionNext" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" /> 

</android.support.design.widget.TextInputLayout> 

<android.support.design.widget.TextInputLayout 
    android:textColorHint="@color/color_80ffffff" 
    android:id="@+id/input_layout_password" 
    android:layout_marginLeft="46dp" 
    android:hint=" " 
    android:theme="@style/EditTextLogin" 
    android:layout_marginRight="46dp" 
    android:layout_below="@+id/input_layout_email" 
    app:errorTextAppearance="@style/error_appearance" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <android.support.v7.widget.AppCompatEditText 
     android:id="@+id/password" 
     android:gravity="center" 
     android:textColorHint="@color/color_80ffffff" 
     android:hint="@string/hint_password" 
     android:textColor="@android:color/white" 
     android:textSize="14sp" 
     android:inputType="textPassword" 
     android:imeOptions="actionDone" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 

</android.support.design.widget.TextInputLayout> 

<Button 
    android:layout_below="@+id/input_layout_password" 
    android:id="@+id/btn_sign_in" 
    android:textColor="@android:color/white" 
    android:text="@string/btn_login" 
    android:layout_marginTop="26dp" 
    android:background="@color/colorAccent" 
    android:layout_marginRight="60dp" 
    android:layout_marginLeft="60dp" 
    android:layout_width="match_parent" 
    android:layout_height="40dp" /> 

<RelativeLayout 
    android:layout_marginTop="17dp" 
    android:layout_below="@+id/btn_sign_in" 
    android:gravity="center" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <TextView 
     android:id="@+id/label_sign_up" 
     android:textSize="14sp" 
     android:text="@string/lbl_sign_up" 
     android:textColor="@color/color_80ffffff" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" /> 

    <TextView 
     android:layout_toRightOf="@+id/label_sign_up" 
     android:textStyle="bold" 
     android:layout_marginLeft="5dp" 
     android:id="@+id/btn_sign_up" 
     android:textSize="14sp" 
     android:text="@string/txt_sign_up" 
     android:textColor="@android:color/white" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" /> 

</RelativeLayout> 

<TextView 
    android:id="@+id/forgot_password" 
    android:textColor="@color/color_80ffffff" 
    android:textSize="14sp" 
    android:gravity="center" 
    android:text="@string/text_forgot_password" 
    android:layout_marginBottom="20dp" 
    android:layout_alignParentBottom="true" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" /> 

<RelativeLayout 
    android:visibility="gone" 
    android:id="@+id/layout_resend" 
    android:layout_alignParentBottom="true" 
    android:layout_width="match_parent" 
    android:layout_height="86dp"> 

    <ImageView 
     android:scaleType="fitXY" 
     android:src="@drawable/pink_bar" 
     android:layout_width="match_parent" 
     android:layout_height="86dp" /> 

    <Button 
     android:id="@+id/btn_resend" 
     android:layout_marginRight="10dp" 
     android:layout_alignParentRight="true" 
     android:layout_marginTop="26dp" 
     android:textSize="14sp" 
     android:text="@string/txt_resend" 
     android:textColor="@color/color_505065" 
     android:background="@android:color/transparent" 
     android:layout_width="wrap_content" 
     android:layout_height="40dp" /> 

    <ImageView 
     android:id="@+id/ic_email" 
     android:layout_marginLeft="16dp" 
     android:layout_marginTop="26dp" 
     android:src="@drawable/ic_email_confirmation_white" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" /> 

    <TextView 
     android:layout_marginLeft="15dp" 
     android:layout_toRightOf="@+id/ic_email" 
     android:layout_toLeftOf="@+id/btn_resend" 
     android:layout_marginTop="26dp" 
     android:textSize="14sp" 
     android:text="@string/text_resend_email" 
     android:textColor="@android:color/white" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 

</RelativeLayout> 

<RelativeLayout 
    android:visibility="gone" 
    android:id="@+id/load" 
    android:background="#aa000000" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <ProgressBar 
     android:layout_centerVertical="true" 
     android:layout_centerHorizontal="true" 
     android:layout_width="50dp" 
     android:layout_height="50dp" /> 
</RelativeLayout> 

我不知道为什么发生这种情况

回答

0

我看不出有什么毛病你的布局层次。事情可能有点奇怪,因为你使用的图像作为背景,没有固定的高度和宽度。我不知道这是XML背景还是图像文件,但是如果是后者,我建议在相对布局中使用具有固定大小和缩放类型定义的图像视图。

+1

删除后台解决我的问题,但我需要这个BG,我怎么能调整这个图像在我的背景?任何建议? – victorldavila