iOS Question [Solved] B4XFloatTextField isn't centering hint

Status
Not open for further replies.

Lori Scott

Member
Licensed User
I am using B4XFloatTextField so that I can use the Accept feature to get the iPhone number keypad to close.

For this view, I selected the option for centered text but the text is still left-justified. A bug? or am I doing something wrong?

you can try with:
B4X:
B4XFloatTextField1.TextField.SetTextAlignment("CENTER","CENTER")
Or any combination you need.

This centers the main text but not the hint text. Is there an option like .setHintAlignment? Font size of hint does not match font size of main text either. Can I influence position and font size of the hint in a B4XFloatTExtField?
 

Lori Scott

Member
Licensed User
I tried like this
B4X:
B4XFloatTextField1.HintFont(B4XFloatTextField1.Update)

getting an error message: Array expected
 
Upvote 0

Lori Scott

Member
Licensed User
Also tried:
B4X:
B4XFloatTextField1.HintFont.Size(B4XFloatTextField1.TextField.Font.Size)
    B4XFloatTextField1.Update

Same error.
 
Upvote 0

Lori Scott

Member
Licensed User
B4XFloatTextField1.HintFont = xui.CreateDefaultBoldFont(20)

In the attached project, I entered it this way. I'm not getting an error message any more :). But it doesn't seem to have any affect on the font size of the hint :confused:.
 

Attachments

  • hintFont.zip
    926 bytes · Views: 229
Upvote 0

Lori Scott

Member
Licensed User
You can change the hint sizes with:
B4X:
SearchField.LargeLabelTextSize = 14
SearchField.SmallLabelTextSize = 10
SearchField.Update


SearchField is new to me. Please point me to the SearchField documentation or tutorial so I can study the basics of how to use it. What Library do I need? Looking in the forum gives me some idea but not the basics how to use it.
 
Upvote 0

Lori Scott

Member
Licensed User
Oh, thank you for clarifying. I am working at the steep end of the learning curve. I don't always interpret things the 'obvious' way.

Yes, that works.
 
Upvote 0
Status
Not open for further replies.
Top