如何在android中单击EditText(如android中的facebook登录)时进行背景向上推

如何在android中单击EditText(如android中的facebook登录)时进行背景向上推,android,android-edittext,facebook-login,Android,Android Edittext,Facebook Login,我试图使我的登录页面像facebook登录。所有的事情都完成了,但有一件事还没有完成,那就是当我点击电子邮件时,键盘盖上了我的密码,所以我无法输入密码。如何使我的电子邮件密码登录按钮按下时,点击在电子邮件?这是我的xml <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width

我试图使我的登录页面像facebook登录。所有的事情都完成了,但有一件事还没有完成,那就是当我点击电子邮件时,键盘盖上了我的密码,所以我无法输入密码。如何使我的电子邮件密码登录按钮按下时,点击在电子邮件?这是我的xml

<?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" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent" >


    <LinearLayout
        style="@style/bg_layout"
        android:layout_width="match_parent"
        android:layout_height="533dp"
        android:orientation="vertical"
        android:weightSum="2" >

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="41dp"
            android:background="@drawable/navbar_stay"
            android:paddingRight="5dp" >

            <ImageButton
                android:id="@+id/imageButton1"
                style="@style/st_close"
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:src="@drawable/click_close" />

            <ImageView
                android:id="@+id/btn_upload"
                style="@style/st_upload"
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:layout_alignParentRight="true"
                android:layout_alignTop="@+id/imageButton1"
                android:src="@drawable/click_upload" />
        </RelativeLayout>

        <EditText
            android:id="@+id/editText1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#00000000"
            android:ems="10"
            android:focusable="false"
            android:hint="What are you doing here"
            android:paddingLeft="10dp" >

            <requestFocus />
        </EditText>

        <Space
            android:layout_width="match_parent"
            android:layout_height="200dp" />

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingRight="5dp" >

            <ImageView
                android:id="@+id/im_upload"
                android:layout_width="80dp"
                android:layout_height="60dp"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:layout_marginLeft="10dp"
                android:paddingRight="5dp"
                android:scaleType="fitXY"
                android:src="@drawable/card_base" />

            <LinearLayout
                android:id="@+id/linearLayout1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBottom="@+id/im_upload"
                android:layout_toRightOf="@+id/im_upload"
                android:background="@drawable/fillbox_place"
                android:orientation="vertical" >

                <EditText
                    android:id="@+id/editText2"
                    android:layout_width="197dp"
                    android:layout_height="40dp"
                    android:layout_gravity="right"
                    android:background="#00000000"
                    android:ems="10"
                    android:hint="What is the name of this place?"
                    android:textSize="12sp" />
            </LinearLayout>

            <DigitalClock
                android:id="@+id/digitalClock1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_above="@+id/linearLayout1"
                android:layout_alignLeft="@+id/linearLayout1"
                android:text="DigitalClock" />
        </RelativeLayout>
    </LinearLayout>
</LinearLayout>

</ScrollView>


尝试设置滚动视图的高度

在垂直滚动布局中创建您的布局我在垂直滚动布局中创建了布局,但它不起作用。当我们启动facebook时,在facebook登录中再添加一个,直到触按电子邮件或密码,键盘才会显示。当我设置focusable=“false”时,它工作正常,但当我触摸EditText键入字母时,它不允许我。我不会打字。我该怎么做?我认为edittext的默认行为是,当它聚焦时,键盘会显示出来。是的,但我不想在启动应用程序时显示它。如果我设置focusable=“false”,它将不显示,但我无法将文本键入。在通过我的应用程序打开facebook时,我单击任何编辑文本作为一个文本,否则我将无法获取键盘