0
我有一个布局,它有肖像时的总和规格。但是当我改变屏幕方向时,布局需要重新整理以适应整个屏幕。问题是布局保持他的尺寸。所以如果布局开始纵向,我改变为横向布局保持纵向配置。我怎样才能让自己的布局自动重组屏幕方向的变化?重新组织钛定向变化的布局
如何创建自己的看法:
var deviceHeight = Ti.Platform.displayCaps.platformHeight,
deviceWidth = Ti.Platform.displayCaps.platformWidth,
platform = Ti.Platform.osname;
if (platform == 'android') {
deviceHeight = Math.round(Ti.Platform.displayCaps.platformHeight/Ti.Platform.displayCaps.logicalDensityFactor);
deviceWidth = Math.round(Ti.Platform.displayCaps.platformWidth/Ti.Platform.displayCaps.logicalDensityFactor);
}
var View = Ti.UI.createView({
height : deviceHeight,
width : deviceWidth,
backgroundColor : 'white',
layout : 'vertical'
});
请海我编辑的帖子 –
你真的不想自定义做与设备的宽度和高度。然后你将不得不手动重绘每一个元素。看我的编辑 –