在新视图下,Android滚动关闭/打开键盘视图仍然留下深刻印象

时间:2016-04-17 00:47:55

标签: android android-layout

我在测试我的第一个Android应用时遇到问题, 每次我滚动或打开/关闭键盘 我看到这样的事情  screenshoot

这是我的清单,背景颜色这对我有帮助; 现在效果是几秒钟,然后看到所有正常的

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:orientation="vertical"
    android:layout_height="match_parent"
    android:layout_gravity="top" android:gravity="top"
    android:background="@color/black_overlay"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent">

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/scrollView"
    android:orientation="vertical"
    android:backgroundTint="@color/black_overlay"
    android:layout_gravity="center_horizontal"
    android:layout_marginBottom="66dp"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <LinearLayout 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:padding="10dp"
        android:id="@+id/rootusersettinglayout"
        tools:context="com.lvapp.bytunes.activity.RegisterActivity"
        android:weightSum="1">

        <ImageView
            android:layout_width="180dp"
            android:layout_height="180dp"
            android:layout_gravity="center_horizontal"
            android:background="@drawable/head_usersetting"
            android:layout_marginTop="5dp"
            android:id="@+id/etImage"
            />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/modify_settings"
            android:id="@+id/toplabel"
            android:layout_gravity="center_horizontal"
            android:textSize="22dp"
            android:textColor="@color/orangehex"
            android:gravity="center"
            android:textStyle="bold"/>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@android:color/darker_gray"
            android:layout_marginTop="10dp"
            android:text="Email"
            android:textSize="20dp"
            android:id="@+id/etEmail" />


        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/etPassword"
            android:singleLine="true"
            android:inputType="textPassword"
            android:textColorHint="@color/orangehex"
            android:textColor="@android:color/darker_gray"
            android:backgroundTint="@android:color/darker_gray"
            android:hint="@string/reg_password"/>

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/etLocationName"
            android:singleLine="true"
            android:textColorHint="@color/orangehex"
            android:textColor="@android:color/darker_gray"
            android:backgroundTint="@android:color/darker_gray"
            android:hint="@string/reg_location_name"
            android:maxLength="50" />

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/etAddress"
            android:singleLine="true"
            android:textColorHint="@color/orangehex"
            android:textColor="@android:color/darker_gray"
            android:backgroundTint="@android:color/darker_gray"
            android:hint="@string/reg_street"
            android:visibility="gone" />

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/etCity"
            android:singleLine="true"
            android:textColorHint="@color/orangehex"
            android:textColor="@android:color/darker_gray"
            android:backgroundTint="@android:color/darker_gray"
            android:hint="@string/reg_city"
            android:visibility="gone" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@color/orangehex"
            android:id="@+id/lblCountry"
            android:backgroundTint="@android:color/transparent"
            android:text="@string/reg_choose_country"
            android:visibility="gone" />

        <ListView
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="150dp"
            android:divider="@android:color/darker_gray"
            android:dividerHeight="1dp"
            android:scrollbars="vertical"
            android:choiceMode="singleChoice"
            android:descendantFocusability="blocksDescendants"
            android:id="@+id/listViewCountry"
            android:drawSelectorOnTop="true"
            />

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/etPhone"
            android:singleLine="true"
            android:textColorHint="@color/orangehex"
            android:textColor="@android:color/darker_gray"
            android:backgroundTint="@android:color/darker_gray"
            android:hint="@string/reg_phone"
            android:inputType="phone" />

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/etWww"
            android:singleLine="true"
            android:textColorHint="@color/orangehex"
            android:textColor="@android:color/darker_gray"
            android:backgroundTint="@android:color/darker_gray"
            android:hint="@string/reg_web"
            android:inputType="textUri" />

        <Spinner
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:singleLine="true"
            android:id="@+id/etType"
            android:textColorHint="@color/orangehex"
            android:textColor="@android:color/darker_gray"
            android:backgroundTint="@android:color/darker_gray"
            android:prompt="@string/type_title"
            android:hint="@string/type_title"
            android:layout_below="@+id/spinner_item"
            android:touchscreenBlocksFocus="false" />

        <Button
            android:layout_width="100dp"
            android:layout_height="50dp"
            android:text="@string/save_confirm"
            android:id="@+id/btnSaveSetting"
            android:textStyle="bold"
            android:textColor="@android:color/white"
            android:background="@drawable/button_background_orange"
            android:layout_gravity="center"/>

    </LinearLayout>
</ScrollView>

    <include android:layout_gravity="bottom" android:layout_alignParentBottom="true"
        android:layout_width="match_parent" android:layout_height="66dp" layout="@layout/user_toolbar_bottom"/>

</RelativeLayout>

0 个答案:

没有答案