2

キーボードが表示されているときに自分のアクティビティレイアウトのサイズを変更すると同時に、ツールバーの位置を変更しないでください。これまではすべての画面が上にシフトし、編集テキストをクリックするとキーボードが表示されます。キーボードの前にソフトキーボードが表示されたときにツールバーが上に移動する

が表示されます。

キーボードが表示されたら、ツールバーはもう見えない。

enter image description here

私はその場所にキーボードを維持したいとその下にシフトします画像。 キーボードが表示されたときに編集テキストが表示されなくなるため、マニフェストで指定できるのはandroid:windowSoftInputMode="adjustNothing"です。

これまでのところ、私は次のコードを使用したAndroidManifest.xmlで

:レイアウトで

android:windowSoftInputMode="adjustPan|stateHidden" 

<?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" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@android:color/white" 
    android:clickable="true" 
    android:fitsSystemWindows="true" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    tools:context="studentplanner.mobile.yardi.com.studplan.presentation.activities.PersonalInformationActivity"> 

    <android.support.v7.widget.Toolbar 
     android:id="@+id/toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="@dimen/toolbar_and_button_height" 
     android:layout_alignParentStart="true" 
     android:layout_alignParentTop="true" 
     android:elevation="4dp" 
     android:background="@color/main"> 

     <TextView 
      android:id="@+id/toolbar_title" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:text="@string/personal_information_text" 
      android:textColor="@android:color/white" 
      android:textSize="@dimen/medium2_text_size" /> 

    </android.support.v7.widget.Toolbar> 

    <ImageView 
     android:id="@+id/background_container" 
     android:layout_width="match_parent" 
     android:layout_height="@dimen/extra_large5_dimen" 
     android:layout_below="@+id/toolbar" 
     android:scaleType="center" 
     android:src="@drawable/userbackground" /> 

を...

すべてのヘルプは歓迎されます!

+0

uのアクティビティを使用したのか?空のアクティビティまたは空のアクティビティ? –

+0

空の活動、サー。 –

+0

この空白の活動をしてください。 –

答えて

-1

AndroidManifest.xmlのandroid:windowSoftInputMode = "adjustResize"を追加すると、問題が解決します。 styles.xmlで

<activity 
     android:name=".MainActivity" 
     android:label="@string/activity_main" 
     android:windowSoftInputMode="adjustResize"> 
</activity> 
+1

android:windowSoftInputMode = "adjustResize"これは私の問題を解決しませんでした。なぜなら、キーボードは編集テキストを覆い隠すからです。 –

0

<item name="android:windowTranslucentStatus">true</item>

は、あなたの活動の親のレイアウト にandroid:fitsSystemWindows="true"を追加し、追加android:windowSoftInputMode="adjustResize"をマニフェスト

+0

android:windowSoftInputMode = "adjustResize"これは私の問題を解決しませんでした。なぜなら、キーボードは編集テキストを覆い隠すからです。 trueはAndroidシステムツールバーを半透明にしましたが、アプリケーションツールバーには影響しませんでした。 –

0

スタイルで

<item name="android:windowTranslucentStatus">true</item> 

を提出し、追加

android:fitsSystemWindows="true" 

あなたのアクティビティのParentLayout

+1

trueは、Androidシステムツールバーを半透明にしましたが、アプリケーションツールバーには影響しませんでした。 –

0

私は同じ問題がありました。
フラグメントを扱うとき、framelayoutの中にisScrollContainerを置き、すべてのキーボードの問題を解決します。

<FrameLayout android:id="@+id/container_framelayout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:isScrollContainer="true"/> 

すべてが必要です。

いますが、フラグメント拠点ごとにTIをしたいならば、onCreateViewフラグメントコールバックでコンテナをスクロールし、あなたのコンテナを設定することで、次の操作を行います。

@Nullable 
    @Override 
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 
     View rootView = inflater.inflate(R.layout.activity_type_barcode, container, false); 
     container.setScrollContainer(true); 

     return rootView; 
    } 
関連する問題