Placing an nuicontainerelement below a text

Hi
I am trying to place an nUIContainerElement below a text, but it’s not working as expected.
In my case
view.setHeight(CURRENT_SCREEN_HEIGHT - main_navbar_view.getHeight());
favsContainer.setHeight(view.getHeight() - welcomeText.getHeight() - selectText.getHeight());
The problem is:

  1. the height of the text elements (38 ) seems not to be the “real” one. The next element is placed in Y = 50.
  2. in android, I don’t get height or Y from the text elements

Many thanks
Javier

Hi Javier,

You need to be careful with methods like getHeight - remember, until the view has been added to a window, the view itself will have no concept of what its dimensions may actually be (you could be adding the view to a full-screen window, or a tiny window you’ve created for some other purposes). Similarly for a textfield - until the parent chain has been created, it won’t know for certain what it’s own width may be and, as a result, it’s height when the supplied text is line-broken based on that width.

Regards,

Nick.