Android的工作室布局previews的列表视图+的GridView [英] Android Studio layout previews for Listview + Gridview

查看:213
本文介绍了Android的工作室布局previews的列表视图+的GridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让机器人工作室的布局preVIEW屏幕填充的GridView或ListView与实际运行时的布局占位看法?

Is there a way to get Android Studio's layout preview screen to populate a GridView or ListView with placeholder views of the actual runtime layout?

换句话说,我不希望看到第1项/子项1的意见,我希望能够到的地方设置@布局/ foo和有它出现在那里的网格。

In other words, I don't want to see a grid of "Item 1/ Sub Item 1" views, I want to be able to set @layout/foo somewhere and have it show up in there.

推荐答案

从图形编辑器:

从XML:

<GridView
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:numColumns="2"
        tools:listitem="@layout/grid_item"/>

注:注意这ISSE: http://stackoverflow.com/a/12188118/624706

这篇关于Android的工作室布局previews的列表视图+的GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆