iOS Question TextView Hint Text problem

Baris Karadeniz

Active Member
Licensed User
I ma sure it is very easy but unfortunately I can't see the written statement for textview hinttext. What can be the problem?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should set the hint text with the designer:
SS-2016-05-18_16.05.00.png


It will only appear when the text is empty. Note that a better option is to use FloatLabeledEditText: https://www.b4x.com/android/forum/threads/floatlabelededittext-iui8.64096/#content
 
Upvote 0

Baris Karadeniz

Active Member
Licensed User
I wrote hint text exactly to the place which you show. But it is not seen on the screen. That is why I am surprised and asked. What can be my fault?
 
Upvote 0

Baris Karadeniz

Active Member
Licensed User
Ok. I will try in another small project. Is it possible to translate HintText? if it is written in designer how it will be? Isn't it possible to write as;

B4X:
TextFieldx.HintText = "Hello"
 
Upvote 0

Baris Karadeniz

Active Member
Licensed User
I think, I saw the problem. Background colour of textfield is black and the font color of the hinttext is gray. So, I can't see. How can I change HintText color?
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
I think, I saw the problem. Background colour of textfield is black and the font color of the hinttext is gray. So, I can't see. How can I change HintText color?

lets say you are having problem with txtusername.text
use below code under aapplicatio_start:

B4X:
Dim NoTxtField As NativeObject = txtusername
Dim AttrTxt As AttributedString
AttrTxt.Initialize(txtusername.HintText, txtusername.Font, Colors.white)
NoTxtField.SetField("attributedPlaceholder", AttrTxt )

this will set the hint color of txtusername.text to white. ( dont forget to set the hinttext in designer for example: "Kullanıcı Adınız" for the txtusername.text )
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
they are the same.But you have to write this code before the code i gave . Because it will take the hinttext of textview so you have to set textfieldx.hinttext = "Hello"
before the code i wrote above.
 
Upvote 0

Baris Karadeniz

Active Member
Licensed User
Ok. I did as you said. When the app starts, it is ok. But when the hint text translated to another language it disappears again. So, do I need to write your codes for each translation place?
 
Upvote 0
Top