嗨,我是钛新手,不知道如何使用其 TSS 创建流体设计。如何放置三个视图,一个作为页眉(20%),两个作为内容持有者(60%),三个作为页脚(20%),全宽(Ti.UI.FILL)。我的代码是,
索引.xml
<Alloy>
<Window class="container">
<Require src="home" id="home"></Require>
</Window>
</Alloy>
主页.xml
<Alloy>
<View id="header"></View>
<View id="content"></View>
<View id="footer"></View>
</Alloy>
主页.tss
"#home": {
layout: 'vertical',
width: Ti.UI.FILL,
height: Ti.UI.FILL,
backgroundColor: '#000'
},
'#header':{
layout: 'horizontal',
height: '20%',
width: Ti.UI.FILL,
backgroundColor: '#fff'
},
'#content': {
layout: 'vertical',
height: '60%',
width: Ti.UI.FILL,
backgroundColor: '#ccc'
},
'#footer': {
layout: 'horizontal',
height: '20%',
width: Ti.UI.FILL,
backgroundColor: '#fff'
}
我正在尝试将后退按钮(左)、标题(中)和刷新按钮(右)作为水平布局放置在标题视图中,并将应用程序内容放置在内容视图和页脚视图中,并通过滚动进行一些选择(即,我们可以通过在其上放置选项来使用幻灯片事件滚动)。如果我运行此代码,视图最终会像这样划分,并且 60% 不会影响内容视图。我已经在 appcelerator 论坛中询问过,并没有得到答复。希望这可以帮助。