2016-10-03 11 views
1

テキストビュー、ボタン、およびImageViewを持つフラグメントのEditTextを使用しています。キーボード編集時に表示されないAndroid EditTextタイプのテキスト

私の問題は、次のとおりです。

キーボードが表示されたとき、私は何イムタイピングを参照してください傾けます。

私のXMLコードは次のとおりです。キーボードが表示されたときに

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:tools="http://schemas.android.com/tools" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@android:color/background_light" 
     android:clickable="true"> 

     <!-- TODO: Update blank fragment layout --> 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:padding="5dp"> 

      <ScrollView 
       android:layout_width="match_parent" 
       android:layout_height="match_parent"> 

       <LinearLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:orientation="vertical"> 

        <ImageView 
         android:layout_width="match_parent" 
         android:layout_height="190dp" 
         android:background="@drawable/header" /> 

        <TextView 
         android:id="@+id/head" 
         style="@style/Base.TextAppearance.AppCompat.Large" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:text="sub heading" /> 

        <android.support.design.widget.TextInputLayout 
         android:id="@+id/request_til" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content"> 

         <EditText 
          android:id="@+id/request_et" 
          android:layout_width="match_parent" 
          android:layout_height="wrap_content" 
          android:hint="Enter your Name and Address here" 
          android:maxLines="10" 
          android:minLines="6" /> 
        </android.support.design.widget.TextInputLayout> 
       </LinearLayout> 

      </ScrollView> 

      <Button 
       android:id="@+id/request_btn" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_alignParentBottom="true" 
       android:background="@color/colorPrimary" 
       android:text="Button" 
       android:textColor="@android:color/background_light" /> 
     </RelativeLayout> 
    </FrameLayout> 

スクリーンショットを私はその後、私は何を参照することができなくなり何イムを入力した後に enter image description here

を入力して、キーボードを参照カント私が入力した: enter image description here

誰かが私の問題

+1

これは一種の機密アプリですか? – Leonardo

+0

@ LeonardoFerrari:ここに問題がありますか? –

+1

ボタンに制約が必要です。 「スクロール・ビューの下のレイアウト」を選択して、すでに追加したボトム・トップを整列させます。 –

答えて

1

使用RelativeLayoutではなくでframeLayout私を解決するために私を助けてくださいとあなたが私はそれが我々が

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@android:color/background_light" 
    android:clickable="true"> 

     <ScrollView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 

      <RelativeLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:padding="5dp"> 

       <ImageView 
        android:id="@+id/img" 
        android:layout_width="match_parent" 
        android:layout_height="190dp" 
        android:background="@drawable/header" /> 

       <TextView 
        android:id="@+id/head" 
        style="@style/Base.TextAppearance.AppCompat.Large" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:text="sub heading" 
        android:layout_below="@+id/img" /> 

       <android.support.design.widget.TextInputLayout 
        android:id="@+id/request_til" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_below="@+id/head"> 

        <EditText 
         android:id="@+id/request_et" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:hint="Enter your Name and Address here" 
         android:maxLines="10" 
         android:minLines="6" /> 
       </android.support.design.widget.TextInputLayout> 
      </RelativeLayout> 

     </ScrollView> 

     <Button 
      android:id="@+id/request_btn" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
      android:background="@color/colorPrimary" 
      android:text="Button" 
      android:textColor="@android:color/background_light" 
      android:layout_gravity="bottom"/> 

</RelativeLayout> 
+0

も同じです。変更なし –

+0

ボタンの下から削除して実行しなければならないと思ったら、ボタンが別の場所に置き換えなければならないと思います。 –

+0

ボタンをレイアウトのbootomに合わせる必要があります。 –

0
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
tools:context="ictnews.iutlab.uz.ictnews.fragments.CommentFragment"> 


<android.support.v4.widget.SwipeRefreshLayout 
    android:id="@+id/swipe_fragment_comment" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_above="@+id/linerlayout" 
    > 

    <android.support.v7.widget.RecyclerView 
     android:id="@+id/recycler_fragment_comment" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_gravity="top" /> 
</android.support.v4.widget.SwipeRefreshLayout> 

<LinearLayout 
    android:id="@+id/linerlayout" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:orientation="horizontal" 
    android:padding="@dimen/space_margin" 
    android:weightSum="1"> 

    <EditText 
     android:id="@+id/edit_fragment_comment" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight=".9" 
     android:hint="@string/comment_hint" 
     android:inputType="text" 
     android:theme="@style/EditTextComment" /> 

    <ImageView 
     android:id="@+id/fab_comment_fragment" 
     android:layout_width="0dp" 
     android:layout_height="30dp" 
     android:layout_weight=".1" 
     android:background="?attr/selectableItemBackground" 
     android:clickable="true" 
     android:src="@drawable/ic_action_send" /> 

</LinearLayout> 

を行く彼女に動作するはずだと思うScrollViewの親のViewGroupを必要とし `tを
関連する問題