2016-12-12 5 views
-1

なぜキーボードがアクティブなときに断片化するのですか?私のEditTextはmykeyboardの一番上に押し込まれません。フラグメントなぜフラグメントで、私のキーボードが押されていないのですか?

In Fragment

写真1において

活性の

In Activity

、それは活性があります。キーボードプッシュビュー 写真2、それはフラグメントです。キーボードはプッシュビューではありません!

答えて

2

マニフェストこれであなたのアクティビティタグに追加する:

アンドロイド:windowSoftInputModeは= "adjustPan"

<activity 
     android:name=".MainActivity" 
     android:windowSoftInputMode="adjustPan"/> 
+0

感謝を、それを使用し、これは結果であり、それはそれは –

+0

を先頭に、すべてのコンテンツをプッシュする、アクティビティのようではありませんあなたのレイアウトやマニフェストのコード – OShiffer

+0

を追加してください私は、コードとマニフェストを追加しました、私をチェック! –

0
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<ListView 
    android:layout_marginBottom="60dp" 
    android:layout_weight="1" 
    android:id="@+id/listChat" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 
</ListView> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@color/white" 
    android:orientation="horizontal" 
    android:padding="10dp" 
    android:layout_alignParentBottom="true"> 

    <EditText 
     android:id="@+id/edtContent" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginRight="15dp" 
     android:layout_weight="1" 
     android:background="@drawable/chat_textbox" 
     android:hint="comment" 
     android:paddingLeft="10dp" 
     android:textSize="12sp" 
     android:textStyle="italic" /> 

    <TextView 
     android:id="@+id/btnSend" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:background="@drawable/send_button" 
     android:textColor="@color/white" /> 
</LinearLayout> 

と私のマニフェスト

<activity android:name=".ActivityHome" android:windowSoftInputMode="adjustPan" > 

     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 

は、私が試してみました、フラグメントに

関連する問題