2012-02-18 101 views
0

我正在使用鈦手機創建Android應用程序。 如何使用垂直佈局創建此界面?鈦手機相對佈局

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


Content View  } height = fill_parent 


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

在官方android sdk中,我們有fill_parent大小以將內容視圖拉伸到底部。將高度設置爲「自動」將根據內容的高度調整高度;將其設置爲「100%」將覆蓋整個屏幕。

一直在尋找這個答案几天,真的很感謝你的幫助。

編輯: 另一個問題,如果標題視圖底部?

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


Content View  } height = fill_parent 


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

回答

2

內容視圖應該是這樣的(就像你也可以用HTML做)

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

如果欄是在底部,只是圍着它轉:

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

謝謝,但如果標題視圖在底部呢? (添加到我原來的問題) – 2012-02-19 06:33:50

+0

轉過來:)這很容易:)添加到我的答案 – 2012-02-19 18:34:44