ListView:项目未首先水平放置。 [英] ListView: Items not being placed horizontally first.

查看:62
本文介绍了ListView:项目未首先水平放置。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在有一个简单的ListView,大约有10个相同大小的div(下面的截图),它们没有漂浮或任何特殊的东西。在屏幕截图中,您会看到三个彩色框,这些是10个div中的前三个。我预计这三个会在顶部,
1 2 3 4 5.但看起来顶行将有1 3 5 7 9项,第2行将有2 4 6 8 10.有什么方法强制ListViews先推水平然后转到下一行?我认为是默认的。代码低于图片。

Have a simple ListView right now with some 10 divs of the same size (screenshot below), they don't float or anything special. In the screenshot you see three coloured boxes, these are the first three of 10 divs. I expect these three to be along the top, 1 2 3 4 5. But it looks like the top row will have items 1 3 5 7 9 and row 2 will have 2 4 6 8 10. Is there some way to force ListViews to push horizontal first then go to the next row? Which I thought was the default. Code is below image.

 

 

<div id="CategoryListView" data-win-control="WinJS.UI.ListView" data-win-options="{selectionMode: 'none'}" style="width:1110px;height:355px;">

   <div class="category-box category-bg-microsoftproducts"></div>  <--  Dark Blue Box
<div class="category-box category-bg-internallob"></div> <-- Light blue box
<div class="category-box category-bg-3rdpartyproducts"></div> <-- Orangy box
<div class="category-box"></div> <div class="category-box"></div> <div class="category-box"></div> <div class="category-box"></div> <div class="category-box"></div> <div class="category-box"></div> <div class="category-box"></div> </div>

推荐答案

Hi H,

GridView布局模式下的ListView可以按照您指定的方式工作。 想象一下,如果您的列表中有400个项目。 您将使用此控件显示前10个项目。 您可以水平滚动以查看
列表中下方的项目。

The ListView in the GridView layout mode is designed to work just as you have specified.  Imagine if there were 400 Items in your list.  You would be displaying the first 10 items using this control.  You would scroll to horizontally to see the items further down in your list.

如果您希望使用不同的布局(特别是在您的情况下只有十个项目并且排列方式不同,你当然可以使用div而不是ListView来实现这一点。

If you wish to have a different layout (specifically in your case only ten items and arranged differently, you can certainly accomplish this using divs and not the ListView.

-Jeff


这篇关于ListView:项目未首先水平放置。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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