hatzisn Expert Licensed User Longtime User Dec 5, 2020 #1 Hey everyone, I tried to add to the Localizator some code to translate the B4XFloatText hint text but I did not succeed. Here is what I have done: Code: For Each v As View In Activity.GetAllViewsRecursive If v.Tag Is B4XFloatTextField Then Dim ft As B4XFloatTextField = v.Tag ft.HintText="OK CHANGED" Exit End If Next I am debugging and I can see that the HintText was changed correctly but it does not show on screen What I did next was this which suggests that probably it will be much more difficult to translate HintText since it is an ImageView. Is that correct? How can I do that? Code: For Each v As View In Activity.GetAllViewsRecursive If v.Tag Is B4XFloatTextField Then Log(v) Dim p As Panel = v For Each w As View In p.GetAllViewsRecursive Log(w) If w Is Label Then Dim l As Label = w If l.Text = "OLD TEXT" Then l.Text = "OK CHANGED" End If End If Next Exit End If Next
Hey everyone, I tried to add to the Localizator some code to translate the B4XFloatText hint text but I did not succeed. Here is what I have done: Code: For Each v As View In Activity.GetAllViewsRecursive If v.Tag Is B4XFloatTextField Then Dim ft As B4XFloatTextField = v.Tag ft.HintText="OK CHANGED" Exit End If Next I am debugging and I can see that the HintText was changed correctly but it does not show on screen What I did next was this which suggests that probably it will be much more difficult to translate HintText since it is an ImageView. Is that correct? How can I do that? Code: For Each v As View In Activity.GetAllViewsRecursive If v.Tag Is B4XFloatTextField Then Log(v) Dim p As Panel = v For Each w As View In p.GetAllViewsRecursive Log(w) If w Is Label Then Dim l As Label = w If l.Text = "OLD TEXT" Then l.Text = "OK CHANGED" End If End If Next Exit End If Next
hatzisn Expert Licensed User Longtime User Dec 5, 2020 #2 I also tried with this with no success: Code: Public Sub LocalizeB4XFloatText(ft As B4XFloatTextField) ft.HintText = strings.GetDefault(ft.HintText, ft.HintText) ft.Text = strings.GetDefault(ft.Text, ft.Text) End Sub Upvote 0
I also tried with this with no success: Code: Public Sub LocalizeB4XFloatText(ft As B4XFloatTextField) ft.HintText = strings.GetDefault(ft.HintText, ft.HintText) ft.Text = strings.GetDefault(ft.Text, ft.Text) End Sub
M Mahares Expert Licensed User Longtime User Dec 5, 2020 #3 hatzisn said: translate the B4XFloatText hint text but I did not succeed. Click to expand... Did you try to change it in the abstract designer. There is a line: Hint text. Change it from : 'Hint' to say 'Greek'. I think that is all you need to do Upvote 0
hatzisn said: translate the B4XFloatText hint text but I did not succeed. Click to expand... Did you try to change it in the abstract designer. There is a line: Hint text. Change it from : 'Hint' to say 'Greek'. I think that is all you need to do
E edm68 Member Licensed User Longtime User Dec 5, 2020 #4 I think after you change the hint properties you need to update. Example: B4X: ftfDlg1.HintText="1234567890" ftfDlg1.HintColor=Colors.Cyan ftfDlg1.Update Upvote 0
I think after you change the hint properties you need to update. Example: B4X: ftfDlg1.HintText="1234567890" ftfDlg1.HintColor=Colors.Cyan ftfDlg1.Update
hatzisn Expert Licensed User Longtime User Dec 5, 2020 #5 edm68 said: I think after you change the hint properties you need to update. Example: B4X: ftfDlg1.HintText="1234567890" ftfDlg1.HintColor=Colors.Cyan ftfDlg1.Update Click to expand... Thanks a lot, this was correct the answer. Upvote 0
edm68 said: I think after you change the hint properties you need to update. Example: B4X: ftfDlg1.HintText="1234567890" ftfDlg1.HintColor=Colors.Cyan ftfDlg1.Update Click to expand... Thanks a lot, this was correct the answer.