0

Iは、アイテムの次のレイアウトでRecyclerViewを有する:遷移は、Android

<?xml version="1.0" encoding="utf-8"?> 
<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:fitsSystemWindows="true"> 

<android.support.v7.widget.RecyclerView 
    android:id="@+id/recyclerview" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_marginLeft="15dp" 
    android:layout_marginRight="15dp" 
    android:layout_marginTop="15dp" 
    android:clipToPadding="false" 
    android:paddingBottom="80dp" 
    android:scrollbars="vertical" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior"/> 

<android.support.design.widget.AppBarLayout 
    android:id="@+id/appbar" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@android:color/transparent" 
    app:elevation="0dp"> 

    <include 
     android:id="@+id/toolbar" 
     layout="@layout/toolbar"/> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="15dp" 
     android:layout_marginRight="15dp" 
     android:layout_marginTop="15dp" 
     android:descendantFocusability="beforeDescendants" 
     android:focusableInTouchMode="true" 
     android:orientation="vertical" 
     > 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" 
      android:transitionName="@string/transition_name_details"> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <android.support.design.widget.TextInputEditText 
        android:id="@+id/name" 
        style="@style/input_text_style" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="@string/name" 
        android:imeOptions="actionDone" 
        android:inputType="text" 
        android:maxLines="1" 
        /> 
      </android.support.design.widget.TextInputLayout> 
     </LinearLayout>... 
:アクティビティは、次のレイアウトで示されている項目をクリック

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:layout_width="match_parent" 
      android:layout_height="?android:attr/listPreferredItemHeight" 
      android:background="?android:attr/selectableItemBackground" 
      android:gravity="center"> 

<LinearLayout 
    android:id="@+id/name_layout" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal" 
    android:transitionName="@string/transition_name_details"> 

    <TextView 
     android:id="@+id/name" 
     style="@style/input_text_style" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:gravity="center_vertical" 
     android:textColor="@color/primaryTextColor"/> 
</LinearLayout> 

残念ながら、TextInputEditTextの値は、2番目のアクティビティが表示されているときに表示されません。しかし、TextInputEditTextをクリックすると値が表示されます。このいずれかに最初のレイアウトを変更する

答えて

0

は、問題を解決:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:id="@+id/name_layout" 
      android:layout_width="match_parent" 
      android:layout_height="?android:attr/listPreferredItemHeight" 
      android:background="?android:attr/selectableItemBackground" 
      android:gravity="center" 
      android:transitionName="@string/transition_name_details"> 


    <TextView 
    android:id="@+id/name" 
    style="@style/input_text_style" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:gravity="center_vertical" 
    android:textColor="@color/primaryTextColor"/> 
</RelativeLayout>