<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@mipmap/loginbackground" //主要是这里的设置 android:fillViewport="true" tools:context="com.example.administrator.jizhan.MainActivity"> </ScrollView> //ScrollView里面只能有一个子控件,可以套用布局
注意点:
如在需要界面出现Activity全屏属性设置, this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);这个去掉 需要去求该属性才可以实现效果:
<2>
只需要在Activity 配置中添加如下即可
<activity android:name=".MainActivity" android:windowSoftInputMode="adjustPan|stateHidden">