2016-12-12 2 views
-1

Почему во фрагменте, когда клавиатура активна, она не нажимает мой EditText на вершину mykeyboard?Почему во фрагменте моя клавиатура не нажимает вид сверху

В деятельности

In Activity

В Фрагмент

In Fragment

фото 1, в деятельности. Keyboard push view to top фото 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> 

Я использую его в фрагменте

Смежные вопросы