我有一个使用的窗口,layout: 'horizontal'
当我添加子视图时,每个都使用width: '50%'
,这很棒,它们都像一个 2 列表一样填充。
但是,我意识到我需要滚动内容,所以我在窗口中添加了一个滚动视图,并将我的子视图添加到滚动视图中 - 但它不起作用。当我layout: 'horizontal'
在滚动视图上使用时,它会尝试使内容水平滚动 - 所有子视图都在一行上(在 UI 上只看到前 2 个)。如果我将其更改为layout: 'vertical'
,它会正确滚动,但视图以 1 列格式布局(一个在另一个之上)
var deals_window = Titanium.UI.createWindow({
title: 'Deals',
layout: 'horizontal'
});
var scrollView = Ti.UI.createScrollView({
showVerticalScrollIndicator: true,
layout: 'horizontal',
scrollType: 'vertical',
contentWidth: '100%',
contentHeight: 'auto',
width: '100%',
height: 'auto'
});
deals_window.add(scrollView);
如何让 scrollView 在垂直滚动时使用“水平”布局行为......?