当我尝试在 Titanium 中添加 100% 高度的视图时出现显示问题 - 它在 Android 上正确显示,但在 iOS 上显示不正确。这是一个简化的代码:
Ti.UI.setBackgroundColor('#000');
var win = Ti.UI.createWindow({
title:'win',
backgroundColor:'#fff'
});
var s = Ti.UI.createView({
width:'100%',
height:'100%',
backgroundColor:'red',
layout: 'horizontal'
});
var r = Ti.UI.createView({
backgroundColor:'yellow',
width:300,
height:'100%' // problem
})
s.add(r);
win.add(s);
win.open();
Android 上的结果(正确):
iPad 上的结果:
如果我将高度设置为有限数字,它确实有效,但我希望视图覆盖整个高度。我怎样才能做到这一点,为什么 100% 高度在 iOS 上不起作用?