iOS Question B4XFloatTextField - no ResignFocus

Arf

Well-Known Member
Licensed User
Longtime User
I'm changing a b4i TextView to a B4XFloatTextField, but the latter doesn't seem to have a ResignFocus member.
I need this to make the keyboard disappear.
Also, RequestFocus doesn't seem to make the keyboard appear.

Is there a different B4X text view I should be using?
Thanks
 

Arf

Well-Known Member
Licensed User
Longtime User
I did try the following:
B4X:
Dim tf As TextField = MyFloatTextField1.TextField
tf.RequestFocus

but get an exception (this is in b4i)
Error occurred on line: 446 (B4XFloatTextField)
Expected: UITextField, object type: UITextView
 
Upvote 0

Arf

Well-Known Member
Licensed User
Longtime User
nevermind, needed to cast as textview not textfield... this works now:

B4X:
Dim tf As TextView = MyFloatTextField1.TextField
tf.ResignFocus
 
Upvote 0

Arf

Well-Known Member
Licensed User
Longtime User
Note that you can call resign focus on the parent directly:
B4X:
B4XPages.GetNativeParent(Me).ResignFocus
Works in B4I but in B4A I get 'member not found', what can I use in B4A?
 
Upvote 0
Top