繁体   English   中英

在Android中单击EditText时如何使背景增加(例如android中的Facebook登录)

[英]How to make background push up when click EditText in android (like facebook login in android)

我试图使我的登录页面像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>

尝试通过设置滚动视图的高度

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM