Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.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:ScrollView在全屏情况下不工作_Android - Fatal编程技术网

Android:ScrollView在全屏情况下不工作

Android:ScrollView在全屏情况下不工作,android,Android,当键盘出现时,我想滚动我的滚动视图。 如果屏幕正常,一切正常 但在全屏情况下,ScrollView不起作用。 下面是我的代码 MyActivity.java import android.app.Activity; import android.os.Bundle; import android.view.WindowManager; public class MyActivity extends Activity { @Override protected void onC

当键盘出现时,我想滚动我的滚动视图。 如果屏幕正常,一切正常 但在全屏情况下,ScrollView不起作用。 下面是我的代码

MyActivity.java

import android.app.Activity;
import android.os.Bundle;
import android.view.WindowManager;

public class MyActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
}
main.xml

<?xml version="1.0" encoding="utf-8"?>

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

    <ScrollView
        android:id="@+id/ScrollView01"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"
        android:focusable="true"
        android:focusableInTouchMode="true">

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="center"
            android:orientation="vertical"
            android:weightSum="1.0">

            <LinearLayout
                xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="150dp"
                    android:layout_height="50dp"
                    android:text="@string/user_name"/>

                <EditText
                    android:id="@+id/user_name_signup_edit"
                    android:layout_width="150dp"
                    android:layout_height="50dp"/>

            </LinearLayout>

            <LinearLayout
                xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="150dp"
                    android:layout_height="50dp"
                    android:text="@string/password"/>

                <EditText
                    android:id="@+id/password_signup_edit"
                    android:layout_width="150dp"
                    android:layout_height="50dp"
                    android:inputType="textPassword"/>

            </LinearLayout>

        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <TextView
                android:layout_width="150dp"
                android:layout_height="50dp"
                android:text="@string/confirm_password"/>

            <EditText
                android:id="@+id/confirm_password_signup_edit"
                android:layout_width="150dp"
                android:layout_height="50dp"
                android:inputType="textPassword"/>

        </LinearLayout>

        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <TextView
                android:layout_width="150dp"
                android:layout_height="50dp"
                android:inputType="textEmailAddress"
                android:text="@string/email"/>

            <EditText
                android:id="@+id/email_edit"
                android:layout_width="150dp"
                android:layout_height="50dp"/>

        </LinearLayout>

        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <TextView
                android:layout_width="150dp"
                android:layout_height="50dp"
                android:text="@string/name"/>

            <EditText
                android:id="@+id/name_edit"
                android:layout_width="150dp"
                android:layout_height="50dp"/>

        </LinearLayout>

        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <TextView
                android:layout_width="150dp"
                android:layout_height="50dp"
                android:text="language"/>

            <Spinner
                android:id="@+id/language_spinner"
                android:layout_width="150dp"
                android:layout_height="50dp"/>

        </LinearLayout>

            <Button
                android:id="@+id/sign_up_button"
                android:layout_width="150dp"
                android:layout_height="50dp"
                android:layout_gravity="center"
                android:gravity="center"
                android:text="Sign up"/>

        </LinearLayout>

    </ScrollView>

</LinearLayout>
列表项 在ScrollView中使用wrap_内容

也许有点晚了,但即使只是为了清楚/未来的人们会看到这一点