add textfields in coronaCards iOs

Hello everyone,

The native API is not working in ccards iOs, so i try to implement native textfields in swift. Until then everything is fine, but when I click on my textfield (and keyboard appears), the screen (corona view actually) turns black behind the textfield. Does anyone ever faced this problem? Or is it a CoronaCards bug?

I did my tests on iphone 4s + ios 8.1.

Here is my swift code, very simple:

var textField = UITextField(frame: CGRectMake(40.00,180.00, 230.00, 50.00))          textField.backgroundColor = UIColor.whiteColor()          textField.borderStyle = UITextBorderStyle.Line self.coronaView.addSubview(textField)

I don’t think you can add the text field to the coronaView like you’re doing in the last line.  In Corona SDK native objects sit on top of the OpenGL canvas.  With CoronaCards, the coronaView is the OpenGL canvas.  So just create your text fields and draw them on top of the CoronaView.

Rob

Hi Rob,

Yes you can add textfields this way. The problem comes when you try to write something in it. It works but when keyboard appears, textefields remain but all things behind turn black.

I try to make my textfield in a more classic way with xcode interface builder, but no change.

When i touch my textfield to write something in it, all corona display objects turn black on my iphone 4s. Can someone have tried to add textfields or any other native object in a ccards ios project ? Just want to know if i miss something or if it’s a bug…

I don’t think you can add the text field to the coronaView like you’re doing in the last line.  In Corona SDK native objects sit on top of the OpenGL canvas.  With CoronaCards, the coronaView is the OpenGL canvas.  So just create your text fields and draw them on top of the CoronaView.

Rob

Hi Rob,

Yes you can add textfields this way. The problem comes when you try to write something in it. It works but when keyboard appears, textefields remain but all things behind turn black.

I try to make my textfield in a more classic way with xcode interface builder, but no change.

When i touch my textfield to write something in it, all corona display objects turn black on my iphone 4s. Can someone have tried to add textfields or any other native object in a ccards ios project ? Just want to know if i miss something or if it’s a bug…