display.newText failure

I wasn’t sure where to put this, so i put it in iOS, since it only appears on iOS.

I have created an app the shows news stories.
I display the text with:

local story = display.newText(text, 5, 190, display.contentWidth-10, 1100, native.systemFont, 16) story:setTextColor(255, 255, 0)

The text is a simple string and there is nothing weird about it.

It displays just a giant box which is the colour of the text colour.

Does anybody have any ideas why?

I’ve included a screenshot of what it does

Give a try: write 0 instead 1100 value

Give a try: write 0 instead 1100 value

Yes! Thank you so much piotrz55!
Why does it cause that problem?

To be honest - no idea but seen something like this some time ago. Setting height to 0 will make Corona automatically adjust height to fit text height so it’s generaly better to set it to 0 if you don’t want to cut it. Width set as you like.

However there is slight bug or strange behaviour when text is more then few lines heigh. On Android it tends to cut a bit of last line. But there is simple counter to it. Just add “\n” (line break - check slash direction, I’m not sure) to the end of string and everything is fine.

Give a try: write 0 instead 1100 value

Give a try: write 0 instead 1100 value

Yes! Thank you so much piotrz55!
Why does it cause that problem?

To be honest - no idea but seen something like this some time ago. Setting height to 0 will make Corona automatically adjust height to fit text height so it’s generaly better to set it to 0 if you don’t want to cut it. Width set as you like.

However there is slight bug or strange behaviour when text is more then few lines heigh. On Android it tends to cut a bit of last line. But there is simple counter to it. Just add “\n” (line break - check slash direction, I’m not sure) to the end of string and everything is fine.