0

我正在使用 Titanium 移动设备创建 android 应用程序。如何使用垂直布局创建此界面?

----------------
Header View        } height = 40dp
-----------------


 Content View      } height = fill_parent


----------------

在官方的 android sdk 中,我们有 fill_parent 大小来将内容视图拉伸到底部。将高度设置为“自动”将根据内容的高度调整高度;将其设置为“100%”将覆盖整个屏幕。

几天来一直在寻找这个答案,非常感谢您的帮助。

编辑: 另一个问题,如果标题视图位于底部怎么办?

-----------------


 Content View      } height = fill_parent


----------------
 Header View        } height = 40dp
----------------
4

1 回答 1

2

内容视图应该是这样的(就像你也可以用 HTML 一样)

var content_view = Ti.UI.createView({
    top: 40,
    bottom: 0
});

如果栏在底部,只需将其转过来:

var content_view = Ti.UI.createView({
    top: 0,
    bottom: 40
});
于 2012-02-18T15:49:28.783 回答