Why edittext hides a hidden soft keyboard

I have an image from ScrollViewand several editing texts in one scroll view, but when I click on one EditText, the keyboard size of this image opens. I do not change the size, which for this I add android:windowSoftInputMode="adjustResize|adjustPan|stateVisible"for my activity in the manifest, but now the latter is EditTexthidden behind the keyboard when the keyboard is open, and scrolling does not scroll to the last. xml: `

<include
    android:id="@+id/toolbar"
    layout="@layout/toolbar_without_elevation" />

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="0.25"
    android:background="@color/primary_color"
    android:gravity="center"
    android:orientation="horizontal">

    <TextView
        android:layout_width="@dimen/size_0_dp"
        android:layout_height="match_parent"
        android:layout_weight="0.3" />

    <com.balysv.materialripple.MaterialRippleLayout
        android:id="@+id/rippleChangeProfileImage"
        style="@style/ImageViewRipple"
        android:layout_width="@dimen/size_0_dp"
        android:layout_height="match_parent"
        android:layout_weight="0.4"
        android:gravity="center">

        <de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/imgProfile"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:layout_gravity="center"
            android:layout_margin="@dimen/size_8_dp"
            android:background="@drawable/ic_add_a_photo_white_48dp"
            android:onClick="changeContactPhoto"
            app:civ_border_color="#ffffff"
            app:civ_border_width="2dp" />
    </com.balysv.materialripple.MaterialRippleLayout>

    <TextView
        android:layout_width="@dimen/size_0_dp"
        android:layout_height="match_parent"
        android:layout_weight="0.3" />
</LinearLayout>

<ScrollView
    android:id="@+id/scrollView"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="0.75"
    android:fillViewport="true"
    android:isScrollContainer="false"
    >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <!--android:layout_weight="1"-->


        <LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/size_10_dp"
            android:gravity="center"
            android:orientation="vertical">
            <!--android:layout_marginTop="@dimen/size_10_dp"-->

            <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                android:id="@+id/linearName"
                style="@style/ProfileLinearLayout"
                android:layout_marginBottom="@dimen/size_5_dp">

                <com.rengwuxian.materialedittext.MaterialEditText
                    android:id="@+id/edtName"
                    style="@style/profileDialogEditText"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/size_16_dp"
                    android:layout_marginRight="@dimen/size_16_dp"
                    android:layout_weight="1"
                    android:gravity="right"
                    android:paddingRight="@dimen/size_10_dp"
                    android:singleLine="true"
                    android:textAppearance="?android:attr/textAppearanceLarge"
                    android:textColor="@color/Profile_text_color"
                    android:textSize="@dimen/size_12_sp"
                    app:met_floatingLabel="normal"
                    android:windowSoftInputMode="adjustResize" />

                <ImageView
                    android:id="@+id/imgName"
                    android:layout_width="32dp"
                    android:layout_height="32dp"
                    android:layout_marginRight="16dp"
                    android:layout_marginTop="@dimen/size_15_dp"
                    android:src="@drawable/ic_person_outline_white_24dp" />
            </LinearLayout>

            <ImageView
                android:id="@+id/imageView13"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/size_5_dp"
                android:src="@drawable/item_separator_as_line" />

    //several EditText Like This

        </LinearLayout>

`

+4
source share
2 answers

, ;

+2

<activity>:

android:windowSoftInputMode="adjustPan" 

android:windowSoftInputMode="adjustResize" 

:

<activity
    android:name="com.my.MainActivity"
    android:screenOrientation="portrait"
    android:label="@string/title_activity_main"
    android:windowSoftInputMode="stateVisible|adjustResize" >
</activity>
0

Source: https://habr.com/ru/post/1627659/


All Articles