سؤال

I'm creating android app using Titanium mobile. How do I create this interface using vertical layout?

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


 Content View      } height = fill_parent


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

In the official android sdk, we have fill_parent size to stretch the content view to bottom. Setting height to 'auto' will adjust the height according the height of the content; setting it to '100%' will covers the whole screen.

Been searching this answer for days, really appreciate your helps.

Edit: Another question, what if the header view was at bottom?

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


 Content View      } height = fill_parent


----------------
 Header View        } height = 40dp
----------------
هل كانت مفيدة؟

المحلول

The content view should be like this (like you also can do it with HTML)

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

If the bar is at the bottom, just turn it around:

var content_view = Ti.UI.createView({
    top: 0,
    bottom: 40
});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top