最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How is win-listview height set? - WinJS - Stack Overflow

programmeradmin2浏览0评论

this is driving me up the wall. I cannot figure out how to make the listview's height automatic.

i.e. have the listview's height extend in order to occupy all the space it needs and have the outer container offer a overflow-y scroll feature.

I cannot seem to find any documentation on this unforuntately.

Help would be great. Thanks!

this is driving me up the wall. I cannot figure out how to make the listview's height automatic.

i.e. have the listview's height extend in order to occupy all the space it needs and have the outer container offer a overflow-y scroll feature.

I cannot seem to find any documentation on this unforuntately.

Help would be great. Thanks!

Share Improve this question asked Dec 11, 2012 at 13:32 RadiantHexRadiantHex 25.6k47 gold badges155 silver badges251 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

ListView controls are 400px tall by default. That's on line 1421 of the ui-light.css file. You can override it by adding a rule on your page like:

.win-listview { height: 100%; /* (or you can specify absolutely with something like '600px') */ }

On this page in the dev center it says...

Setting the ListView control's height

The ListView does not dynamically adjust its height to fit your content. For a ListView to render, you must specify an absolute value for its height. The Windows Library for JavaScript style sheets set the ListView control's height to 400 pixels.

From a design standpoint, you probably shouldn't be doing vertical scrolling on a ListView. They're designed to be laid out horizontally (as are apps in general). Combining horizontal and vertical scrolling can make for an awkward user experience. I wrote some articles about this.

发布评论

评论列表(0)

  1. 暂无评论