Use of layout tools attribute

Is there any possible reason for layout tools attribute to not work in Android Studio 3.1.2?It does show tools, but listitem, text etc are not found!

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:text="Test Text"

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

</FrameLayout>

Please see here for the error.

1 answer

  • answered 2018-05-16 04:47 qtmfld

    The attribute tools:text in the RecyclerView element should be fixed.

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <android.support.v7.widget.RecyclerView
            android:id="@+id/recycler"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:listitem="@android:layout/simple_list_item_checked"
            tools:itemCount="3" />
    
    </FrameLayout>
    

    enter image description here