2017-01-11 6 views
0

私はアンドロイドカスタムキーボードを開発中で、この問題に直面しました。私は候補を表示して提案を表示しています。しかし、いくつかのケースでは、アプリケーションでキーボードを使用しようとしていますレイアウトはステータスバーの下にあります。 問題の2つの画像を添付しました。両方のスクリーンショットで赤い四角形が表示されていますが、緑の四角形のキーボードレイアウトで問題がマークされています。 私はこれについての研究を行っており、正しい方法で候補のビューが作成されない場合に発生する可能性がありますが、例に示すように候補のビューを実装しました。ここでThis is an Image from Facebook messenger In this image keyboard is overlapping messengers edit text layout too.ソフトキーボードが開くと、アクティビティがステータスバーの下に表示されます

は、私は候補者が

@Override public View onCreateCandidatesView() { 
    mCandidateView = new CandidateView(this); 
    mCandidateView.setService(this); 
    mCandidateView.setOnTranslitModeChangedListener(this); 
    return mCandidateView; 
}` 

をview.`作成しています私のキーボードxmlファイル

<?xml version="1.0" encoding="utf-8"?> 
<com.innorise.kitkeysarmenian.LatinKeyboardView 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/keyboard" 
android:layout_alignParentBottom="true" 
android:layout_width="match_parent" 
android:layout_height="50dp" 
android:keyTextSize="18dp" 
android:keyTextColor="#000" 
android:background="@color/keyboardBackground" 
android:keyPreviewLayout="@layout/preview" 
android:popupLayout="@layout/keyboard_popup_layout" 
android:drawingCacheQuality="high"> 

、ここでは私の候補者がXML file`を表示しているSoftKeyboardから私のコードスニペットです

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@android:color/white" 
    android:padding="5dp" 
    android:gravity="center"> 
    <android.support.v7.widget.RecyclerView 
    android:layout_width="match_parent" 
    android:layout_height="30dp" 
    android:id="@+id/candidatesList" 
    android:orientation="horizontal" 
    app:layoutManager="android.support.v7.widget.LinearLayoutManager" 
    android:layout_centerVertical="true" 
    android:layout_toLeftOf="@+id/candidateSwitch"/> 
    <TextView 
    android:textSize="18sp" 
    android:visibility="gone" 
    android:text="Translit is off." 
    android:gravity="center" 
    android:id="@+id/translitModeisOff" 
    android:layout_toLeftOf="@+id/candidateSwitch" 
    android:layout_width="match_parent" 
    android:layout_height="30dp" /> 
    <com.rm.rmswitch.RMSwitch 
    android:id="@+id/candidateSwitch" 
    app:switchDesign="slim" 
    app:switchBkgCheckedColor="#4ed736" 
    app:switchBkgNotCheckedColor="#cccccc" 
    android:layout_centerVertical="true" 
    android:layout_alignParentRight="true" 
    app:switchToggleCheckedColor="#aca2a2" 
    app:switchToggleNotCheckedColor="#aca2a2" 
    android:layout_width="50dp" 
    android:layout_height="35dp"/> 
    </RelativeLayout> 

答えて

0

は、マニフェストにこれを追加します。

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

私はキーボードと問題は、私はキーボードを使用していたアプリケーションにこのステートメントを追加することはできません、とキーボードのマニフェストにこれを追加することは助けにはならなかったキーボードで呼ばれる開発しています。 –

関連する問題