Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
底部布局隐藏在移动Android中_Android_Android Layout_Android Fragments - Fatal编程技术网

底部布局隐藏在移动Android中

底部布局隐藏在移动Android中,android,android-layout,android-fragments,Android,Android Layout,Android Fragments,我正在设计android屏幕,我在所有屏幕上都面临着这个问题。我正在使用带选项卡布局的材质设计。问题是选项卡布局中的屏幕底部完全隐藏且不可见。下面是代码 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="match_parent" > <

我正在设计android屏幕,我在所有屏幕上都面临着这个问题。我正在使用带选项卡布局的材质设计。问题是选项卡布局中的屏幕底部完全隐藏且不可见。下面是代码

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="match_parent" >

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

                <RelativeLayout
                    android:id="@+id/rl_reside_immigrants"
                    android:layout_width="fill_parent"
                    android:layout_height="match_parent"
                    android:layout_below="@+id/ll_pi_emigrants"
                    android:layout_marginTop="20dp"
                    android:background="@drawable/ex_sum_rounded_corner"
                    android:padding="10dp" >

                    <LinearLayout
                        android:id="@+id/ll_pi_reside_immigrants"
                        android:layout_width="fill_parent"
                        android:layout_height="match_parent"
                        android:layout_below="@id/ll_pi_reside_slt_date"
                        android:layout_marginTop="10dp"
                        android:orientation="horizontal"
                        android:weightSum="3" >

                        <TextView
                            android:id="@+id/tv_residence_entry"
                            android:text="@string/reside_entry" />

                        <View
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight=".2" />

                        <EditText
                            android:id="@+id/dp_residence_entry"
                            android:onClick="selectDate" />

                        <View
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight=".2" />

                        <TextView
                            android:id="@+id/tv_residence_exit"
                            android:text="@string/reside_exit" />

                        <View
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight=".2" />

                        <EditText
                            android:id="@+id/dp_residence_exit"
                            android:onClick="selectDate" />
                    </LinearLayout>
                </RelativeLayout>

                <TextView
                    android:id="@+id/tv_pi_abt_ur_resedence1"
                    android:layout_below="@+id/rl_reside_immigrants"
                    android:layout_marginTop="20dp"
                    android:text="@string/reside_title" />
            </RelativeLayout>
    </ScrollView>
图形布局

构建后,将显示设备屏幕

在图形布局中,我能够看到正确的屏幕,但当在设备中构建相同的屏幕时,图形布局中的红色标记部分隐藏在所有设备中

我们需要帮助来解决这个问题

谢谢

请使用

<Scrollview> 
    <LinearLayout>
        <RelativeLayout>
        **everything else**
        </RelativeLayout>
    </LinearLayout>
</Scrollview>

因为RelativeLayout不是ScrollView的最佳朋友,但在图形布局中,屏幕看起来不错。你知道为什么构建后屏幕是隐藏的吗?我不知道,但是使用LinearLayout而不是冗余的RelativeLayout,这样你也可以在图形布局中获得一些性能优化,我可以看到一个黄色的警告符号。请您检查一下警告的原因,以及android的RelativeLayout:id=@+id/rl_Residence_移民不需要,因为您有两个RelativeLayout。