我有个布局,
-
<?xml version=
"1.0" encoding=
"utf-8"?>
-
<ScrollView xmlns:android=
"http://schemas.android.com/apk/res/android"
-
android:layout_width=
"match_parent"
-
android:layout_height=
"match_parent"
-
android:background=
"@color/red">
-
-
<RelativeLayout
-
android:layout_width=
"match_parent"
-
android:background=
"@color/black"
-
android:layout_height=
"match_parent">
-
-
-
<ImageView
-
android:id=
"@+id/Ic_background"
-
android:layout_width=
"match_parent"
-
android:layout_height=
"wrap_content"
-
android:src=
"@mipmap/ic_background" />
-
-
-
<EditText
-
android:id=
"@+id/PasswordEdit"
-
android:layout_width=
"match_parent"
-
android:layout_height=
"@dimen/x50"
-
android:layout_below=
"@+id/Ic_background"
-
android:layout_margin=
"@dimen/x10"
-
android:background=
"@drawable/password_back"
-
android:hint=
"密码"
-
android:inputType=
"textPassword"
-
android:padding=
"@dimen/x10"
-
android:textColor=
"@color/black"
-
android:textColorHint=
"@color/dimgray"
-
android:textSize=
"@dimen/x20" />
-
-
<LinearLayout
-
android:layout_width=
"match_parent"
-
android:layout_height=
"wrap_content"
-
android:layout_below=
"@+id/PasswordEdit"
-
android:layout_margin=
"@dimen/x10"
-
android:orientation=
"horizontal">
-
-
<Button
-
android:id=
"@+id/OnbackBton"
-
android:layout_width=
"wrap_content"
-
android:layout_height=
"wrap_content"
-
android:background=
"@mipmap/button"
-
android:paddingLeft=
"@dimen/x35"
-
android:paddingTop=
"@dimen/x10"
-
android:paddingRight=
"@dimen/x35"
-
android:paddingBottom=
"@dimen/x10"
-
android:text=
"返回"
-
android:textColor=
"@color/white"
-
android:textSize=
"@dimen/x15" />
-
-
<View
-
android:layout_width=
"0dp"
-
android:layout_height=
"match_parent"
-
android:layout_weight=
"1" />
-
-
<Button
-
android:id=
"@+id/SubmitBton"
-
android:layout_width=
"wrap_content"
-
android:layout_height=
"wrap_content"
-
android:background=
"@mipmap/button"
-
android:paddingLeft=
"@dimen/x35"
-
android:paddingTop=
"@dimen/x10"
-
android:paddingRight=
"@dimen/x35"
-
android:paddingBottom=
"@dimen/x10"
-
android:text=
"确认"
-
android:textColor=
"@color/white"
-
android:textSize=
"@dimen/x15" />
-
<
/LinearLayout>
-
-
<com.sunchip.vendingmachine.view.BottomStatusBarView
-
android:layout_width="match_parent"
-
android:layout_height="wrap_content"
-
android:layout_alignParentBottom="true" />
-
<
/RelativeLayout>
-
</ScrollView>
看内容,ScrollView里面的RelativeLayout的布局应该是满的,但是实际上,底部的那个自定义view,没有占满底部的位置,如:
一看就没满屏,解决方案====================
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true">在ScrollView的布局加上这句话 :android:fillViewport="true" 就能解决
转载:https://blog.csdn.net/qq_36333309/article/details/110656213
查看评论