2017-03-10 2 views
0

내 활동에 약 7-8 개의 편집 텍스트로 NestedScrollView이 있는데 키보드가 표시되면 위로 이동해야합니다. 나는이 일을 해요하지만 작동하지 않습니다키보드가 표시 될 때 레이아웃이 올라 가지 않습니다.

android:windowSoftInputMode="adjustPan|adjustResize" 

activity.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/activity_login" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/colorPrimary" 
    android:focusableInTouchMode="true" 
    tools:context="com.amir_p.cafino.LoginActivity"> 

    <ImageView 
     android:id="@+id/back_img" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:scaleType="centerCrop" /> 

    <View 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/grayTransparent" /> 

    <android.support.v4.widget.NestedScrollView 
     android:layout_width="match_parent" 
     android:id="@+id/signup_layout" 
     android:fillViewport="true" 
     android:layout_height="wrap_content" 
     android:visibility="gone"> 

     <LinearLayout 
      android:id="@+id/register_layout" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:gravity="center_horizontal" 
      android:orientation="vertical" 
      android:padding="16dp"> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="36dp" 
       android:hint="نام و نام خانوادگی" 
       android:textColorHint="@color/white"> 

       <android.support.design.widget.TextInputEditText 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:backgroundTint="@color/white" /> 
      </android.support.design.widget.TextInputLayout> 

      [...] 
     </LinearLayout> 
    </android.support.v4.widget.NestedScrollView> 
</RelativeLayout> 

답변

0

당신의있는 ScrollView

<android.support.v4.widget.NestedScrollView 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:fillViewport="true" 
    android:visibility="visible"> 

과 매니페스트 추가에 android:fillViewport="true"를 추가하는 시도 :

android:windowSoftInputMode="stateVisible|adjustResize" 

당신은 할 수 progra

getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); 
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); 

전체 화면 모드 크기를 조정하지 않습니다 쌈 fillscreen 모드를 해제합니다.

또는 u는 다른 테마 사용할 수 있습니다 : 그것은 작동하지 않습니다 android:theme="@android:style/Theme.Black.NoTitleBar

+0

합니다. 나는 내 게시물을 업데이트했습니다 –

+0

'android : fillViewport = "false"'... – rafsanahmad007

+0

또한 당신의 활동에 대해 전체 화면 테마를 사용하고 있다면 ... 그것을 변경해야합니다. – rafsanahmad007

관련 문제