2016-06-21 10 views
0

これは私のカスタム警告ダイアログコードであるアンドロイドのソフトキーボードの背後に隠さ -警告ダイアログが

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:fillViewport="true" 
     android:scrollbars="vertical"> 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="@drawable/inset_background_dialog" 
      android:padding="@dimen/dialog_elements_margin"> 

      <TextView 
       android:id="@+id/text_add_address_title_addnewaddress" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" 
       android:layout_alignParentTop="true" 
       android:text="@string/add_new_address_title_addnewaddress" 
       android:textAppearance="?android:attr/textAppearanceMedium"/> 

      <ImageView 
       android:id="@+id/image_close_dialogue_addnewaddress" 
       android:layout_width="@dimen/dialog_close_button" 
       android:layout_height="@dimen/dialog_close_button" 
       android:layout_alignParentEnd="true" 
       android:layout_alignParentRight="true" 
       android:layout_alignParentTop="true" 
       android:layout_marginTop="4dp" 
       android:src="@drawable/ic_unchecked_black"/> 

      <EditText 
       android:id="@+id/edit_address_title_addnewaddress" 
       style="@style/roundedEditText" 
       android:layout_below="@+id/text_add_address_title_addnewaddress" 
       android:hint="@string/address_title_hint_addnewaddress"/> 

      <EditText 
       android:id="@+id/edit_mobile_number_addnewaddress" 
       style="@style/roundedEditText" 
       android:layout_below="@+id/edit_address_title_addnewaddress" 
       android:hint="@string/mobile_number_hint_addnewaddress" 
       android:inputType="number"/> 

      <EditText 
       android:id="@+id/edit_apartment_no_addnewaddress" 
       style="@style/roundedEditText" 
       android:layout_below="@+id/edit_mobile_number_addnewaddress" 
       android:hint="@string/house_no_hint_addnewaddress"/> 

      <EditText 
       android:id="@+id/edit_landmark_addnewaddress" 
       style="@style/roundedEditText" 
       android:layout_below="@+id/edit_apartment_no_addnewaddress" 
       android:hint="@string/landmark_hint_addnewaddress"/> 

      <EditText 
       android:id="@+id/edit_location_addnewaddress" 
       style="@style/roundedEditText" 
       android:layout_below="@+id/edit_landmark_addnewaddress" 
       android:hint="@string/address_hint_addnewaddress"/> 

      <Button 
       android:id="@+id/save_address_addnewaddress" 
       android:layout_width="match_parent" 
       android:layout_height="@dimen/dialog_elements_height" 
       android:layout_below="@+id/edit_location_addnewaddress" 
       android:layout_centerHorizontal="true" 
       android:layout_marginTop="@dimen/dialog_elements_margin" 
       android:background="@drawable/add_button_back_about_product" 
       android:text="@string/save_address_button_addnewaddress" 
       android:textAllCaps="false" 
       android:textColor="@color/tabSelectedTextColor"/> 
      </RelativeLayout> 

    </ScrollView> 

</RelativeLayout> 

問題があり、下部に編集テキストフィールドは、ソフトキーボードの後ろに隠されています。私はアンドロイドにアンドロイドマニフェストを更新しようとしました:windowSoftInputMode = "adjustResize"特定のアクティビティではまだ運がありません。これに対する解決策はありますか?

+0

メインRelativeLayoutを削除するには、スクロールビューのみを使用し、少なくともユーザーは画面を上に移動できます。 –

+0

いいえ、そのdint仕事。 –

+0

アラートダイアログの位置を変更しても問題ありませんか?はいの場合は、topに設定します。 –

答えて

0
<ScrollView> 
<LinearLayout android:orientation="vertical" 
     android:scrollbars="vertical" 
     android:scrollbarAlwaysDrawVerticalTrack="true"> 
    <EditView /> 
    <Button /> 
</LinearLayout> 

はのLinearLayoutの内側にあなたのUIを設定してみてください。

+0

のコードを投稿しているので、このスクロールビューを試してみてください。 –

関連する問題