# Placing an nuicontainerelement below a text

**URL:** <https://techcommunity.softwareag.com/t/placing-an-nuicontainerelement-below-a-text/100331>\
**Category:** Forum\
**Tags:** mobile\
**Created:** [February 6, 2012, 8:14pm UTC](https://techcommunity.softwareag.com/t/placing-an-nuicontainerelement-below-a-text/100331 "2012-02-06T20:14:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javier\_Gallego](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/javier_gallego/32/77_2.png) [@Javier\_Gallego](https://techcommunity.softwareag.com/u/Javier_Gallego)\
**Post date:** [February 6, 2012, 8:14pm UTC](https://techcommunity.softwareag.com/t/placing-an-nuicontainerelement-below-a-text/100331/1 "2012-02-06T20:14:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [February 6, 2012, 8:19pm UTC](https://techcommunity.softwareag.com/t/placing-an-nuicontainerelement-below-a-text/100331/2 "2012-02-06T20:19:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:01pm UTC](https://techcommunity.softwareag.com/t/placing-an-nuicontainerelement-below-a-text/100331/3 "2021-04-02T15:01:51Z")

</div>


