0
私のレイアウトでは、編集テキストとスクロール・ビューがあります。編集テキストをタッチすると、ソフト・キーボードが開いていますが、下にスクロールしようとすると、完全にスクロールしていません。私が完全にスクロールしようとすると、同じケースが発生します。スクロール・ビューは、テキストの編集中に下または上にスクロールできません。
しかし、私はアンドロイドを使用する場合:windowSoftInputModeは=「adjustresize」私は完全に上にスクロールすることができますが、私のキーボードは下の編集text.Iも アンドロイド使用しようとする隠す:windowSoftInputMode =「adjustspan | adjustresize」が、見つかりませんソリューションを。
もう1つの問題は、一致するとユーザーが同じテキストを入力しようとしたときにエラーメッセージが表示されることですが、ソフトキーボードを閉じるとメッセージが正しい位置に付いていません。
その私のレイアウト
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent" >
<include
android:id="@+id/toolbar"
layout="@layout/toolabar"
android:theme="@style/mycustomtoolbartheme"></include>
<ScrollView
android:id="@+id/scrollView_addproductactivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:isScrollContainer="true"
>
<LinearLayout
android:id="@+id/activity_add_product"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp">
<Button
android:id="@+id/btn_save_addProductActivity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="5dp"
android:background="@drawable/shape1"
android:text="Save"
android:textColor="#fff" />
<Button
android:id="@+id/btn_view_addProductActivity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="5dp"
android:background="@drawable/shape1"
android:text="view"
android:textColor="#fff" />
</RelativeLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<AutoCompleteTextView
android:id="@+id/autocomplitePn"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="15dp"
android:hint="Product Name"
android:imeOptions="flagNoExtractUi"
android:inputType="textCapSentences"
android:textSize="20dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<AutoCompleteTextView
android:id="@+id/autocompliteBn"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="15dp"
android:hint="Brand Name"
android:imeOptions="flagNoExtractUi"
android:inputType="textCapSentences"
android:textSize="20dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="@+id/edittext_MN"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="15dp"
android:hint="Model Num"
android:imeOptions="flagNoExtractUi"
android:inputType="textCapSentences"
android:textSize="20dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="@+id/edittext_Quantity"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="15dp"
android:hint="Quantity"
android:imeOptions="flagNoExtractUi"
android:inputType="number"
android:textSize="20dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="@+id/edittext_PPP"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="15dp"
android:hint="Price per Pice"
android:imeOptions="flagNoExtractUi"
android:inputType="numberDecimal"
android:textSize="20dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<AutoCompleteTextView
android:id="@+id/autocomplitecn"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="15dp"
android:hint="Country "
android:imeOptions="flagNoExtractUi"
android:inputType="textCapSentences"
android:textSize="20dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<AutoCompleteTextView
android:id="@+id/autocomplitecolor_name"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="15dp"
android:hint="Color "
android:imeOptions="flagNoExtractUi"
android:inputType="textCapSentences"
android:textSize="20dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="@+id/edittext_ProductSize"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="15dp"
android:hint="Size"
android:imeOptions="flagNoExtractUi"
android:inputType="textCapSentences"
android:textSize="20dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<AutoCompleteTextView
android:id="@+id/autocompliteDname"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="15dp"
android:hint="Dealer Name"
android:imeOptions="flagNoExtractUi"
android:inputType="textCapSentences"
android:textSize="20dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="@+id/edittext_Delleremail"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="15dp"
android:hint="Dealer Email"
android:imeOptions="flagNoExtractUi"
android:inputType="textCapSentences"
android:textSize="20dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="@+id/edittext_DellerPhn"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="15dp"
android:hint="Dealer Phn Num"
android:imeOptions="flagNoExtractUi"
android:inputType="phone"
android:textSize="20dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="@+id/edittext_Delleradd"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="15dp"
android:hint="Dealer Add"
android:imeOptions="flagNoExtractUi"
android:inputType="textCapSentences"
android:textSize="20dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="@+id/edittext_Dellerfax"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="15dp"
android:hint="Dealer Fax"
android:imeOptions="flagNoExtractUi"
android:inputType="phone"
android:textSize="20dp" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
私は私のマニフェストファイルにこのコードを追加していますが、レイアウトが
<activity android:name="com.example.oggy.productcatalog.AddProductActivity"
android:windowSoftInputMode="adjustResize|stateHidden" />
<activity
android:name="com.example.oggy.productcatalog.AddProductActivity"
android:windowSoftInputMode="adjustPan"
/>
もし私がキーボードだけを使用しているのであれば、私の下の編集テキストフィールドを隠すことができます。また、上または下にスクロールできません。 –
ScrollViewでアンドロイド:fillViewport = "true"を試してください –
isScrollContainerを削除してみるか、falseに設定してください:isScrollContainer = "false" –