Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

text input question
Started by ammar71 Jan 01 2020 05:56 PM

2 replies to this topic

Best Answer roaminggamer , 01 January 2020 - 06:31 PM

See the sample project that comes with the simulator.

 

Samples -> Interface -> Native Display Objects

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ammar71

[GLOBAL: userInfoPane.html]
ammar71
  • Enthusiast

  • 86 posts
  • Corona SDK

Hi all,

 

I need the user to input some text and I noticed that the only way to do this is using native.newTextField.

 

I tried using that in a sample project and it works fine in the simulator but when I upload the project to my Sony (Android) phone, I get a black screen.

 

I basically copied the code from:

https://docs.coronalabs.com/api/library/native/newTextField.html

 

Do I need to add anything extra to the project for it to work on the device?

 

Assuming that the issue is in the phone, I was thinking I should try to write the functionality using the display objects. Something like:

1- Draw a box

2- Put a text object on top of the box.

3- Add a listener to the box to show an overlay

4- Draw the keyboard on the overlay using boxes/text objects

5- Add a listener on the overlay scene that updates the text object in the parent scene.

 

I am thinking, in order to make the solution multi lingual, I would load the keys from an sqlite db.

 

Did I miss anything? Is it really that simple or am I missing something? 

 



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,613 posts
  • Corona SDK

  Best Answer

See the sample project that comes with the simulator.

 

Samples -> Interface -> Native Display Objects


  • ammar71 and pixec like this

[TOPIC: post.html]
#3

ammar71

[GLOBAL: userInfoPane.html]
ammar71
  • Enthusiast

  • 86 posts
  • Corona SDK

Thanks @roaminggamer

The sample project works on my phone. I'll compare it to my project to see the difference.




[topic_controls]
[/topic_controls]