2

Activity AActivity Bがあります。どちらのレイアウトにもツールバーがありますが、アクティビティ B にはそのEditText下にツールバーがあります。

アクティビティ B:

<android.support.design.widget.CoordinatorLayout
        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="match_parent">

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

    <android.support.design.widget.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_scrollFlags="scroll|enterAlways">

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

            <include layout="@layout/view_toolbar"/>

            <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@android:color/white"
                    android:orientation="vertical">

                <android.support.v7.widget.AppCompatEditText
                        ...
                        android:hint="@string/hint"
                        android:textColor="@color/colorPrimary"
                        android:textColorHint="@color/hint"
                        android:textCursorDrawable="@drawable/customCursor"/>

            </LinearLayout>
        </LinearLayout>

    </android.support.design.widget.CollapsingToolbarLayout>
  </android.support.design.widget.AppBarLayout>
  ... <!--the remaining of the layout-->
</android.support.design.widget.CoordinatorLayout>

アクティビティ A:

<LinearLayout 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="match_parent"
              android:orientation="vertical">

    <include layout="@layout/view_toolbar"/>
    ... <!--the remaining of the layout-->
</LinearLayout>

遷移アニメーションなしでアクティビティ Bを開始すると、EditText にヒントが表示され、カーソルが点滅します。トランジションでアクティビティ Bを開始すると、クリックするまで EditText にヒントもカーソルも表示されません。

移行コード:

if (mUseCompatAnimation) {
     ViewCompat.setTransitionName(findViewById(R.id.activity_AppBarLayout), VIEW_FOR_TRANSITION);
}

VIEW_FOR_TRANSITION =アクティビティ Aツールバー

プログラムでフォーカスをリクエストしようとしましたが、うまくいきませんでした。
何か不足していますか、それともバグでしょうか?

ありがとう。

4

0 に答える 0