Reputation: 658
Official Documentation of Nativescript TextView
According to the link above, there's an attribute called returnKeyType
. But it's not working...
Is there any other proper way to set the returnKeyType? Or simply disable the newline
when pressing the return
key?
Thank you!
Upvotes: 1
Views: 766
Reputation: 253
Try this, this is a suitable approach for your case
let tv = <TextView>page.getViewById("tv");
tv.on("blur", () => {
tv.text = tv.text.replace(/\n/gm, " ");
})
Upvotes: 3
Reputation: 46
I don't get it, if you only need one line, why don't you use TextField instead of TextView? TextField does exactly what you are asking for.
Upvotes: 0
Reputation: 21888
There is a open feature request, but there is also a workaround that should work for now, just use 1
instead of 3
in example.
Upvotes: 0