Is there a way to show a preview of a RecyclerView's contents as Grid in the Android Studio editor?

前端 未结 5 1713
有刺的猬
有刺的猬 2021-02-01 01:45

When I add the RecyclerView to the layout, it shows up as a list view in vertical order. I am using tools:listitem for this. Is there a way, such that it displays a

5条回答
  •  南方客
    南方客 (楼主)
    2021-02-01 01:50

    You are able to build a preview using xmlns:tools="http://schemas.android.com/tools" namespace.

    AndroidX[About]

    
    

    Support

    
    

    From Android studio 3.0 you can predefine a data through the @tools:sample/* resources

    item.xml

    
    
    
        
    
    
    

    As a result your preview will look like

    [More examples]

提交回复
热议问题