0
我在我的活動中有NestedScrollView
,約有7-8個編輯文本,我需要它們在顯示鍵盤時向上移動。我這樣做,但它不工作當顯示鍵盤時佈局不動了
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>
它不工作。我已經更新了我的帖子 –
嘗試設置'android:fillViewport =「false」'... – rafsanahmad007
另外,如果你使用全屏主題進行你的活動...你需要改變它 – rafsanahmad007