jaraiza Active Member Licensed User Longtime User Apr 18, 2017 #1 Hi, I've a problem with Hint text length in small screens. An EditText text has a "Type Cellphone" hint, but in a small screen the text is truncated. So I tried to change it inside "Script Variant" to txtPhone.Hint = "Phone" when the screen is small, but "Hit" is not recognized inside designer Scripts. I tried to use .text instead .hint, but as you may guess, when the user types the phone number the control get mixed text and numbers. I'm currently checking the sizes with: Code: Dim lv As LayoutValues lv = GetDeviceLayoutValues I'm using lv.width and lv.height to determine if I should change hints from code. Is there any way to do it from designer? Thanks!! Last edited: Apr 18, 2017
Hi, I've a problem with Hint text length in small screens. An EditText text has a "Type Cellphone" hint, but in a small screen the text is truncated. So I tried to change it inside "Script Variant" to txtPhone.Hint = "Phone" when the screen is small, but "Hit" is not recognized inside designer Scripts. I tried to use .text instead .hint, but as you may guess, when the user types the phone number the control get mixed text and numbers. I'm currently checking the sizes with: Code: Dim lv As LayoutValues lv = GetDeviceLayoutValues I'm using lv.width and lv.height to determine if I should change hints from code. Is there any way to do it from designer? Thanks!!
LucaMs Expert Licensed User Longtime User Apr 18, 2017 #2 Hint for the hint: write only "Cell Phone", I hope nobody can be so dumb to don't understand You should set it in the properties windows: Upvote 0
Hint for the hint: write only "Cell Phone", I hope nobody can be so dumb to don't understand You should set it in the properties windows:
jaraiza Active Member Licensed User Longtime User Apr 18, 2017 #3 LucaMs said: Hint for the hint: write only "Cell Phone", I hope nobody can be so dumb to don't understand You should set it in the properties windows: View attachment 54864 Click to expand... Do you realize that if you change it there, the change will be made to all variants and not just one of them, don't you? Upvote 0
LucaMs said: Hint for the hint: write only "Cell Phone", I hope nobody can be so dumb to don't understand You should set it in the properties windows: View attachment 54864 Click to expand... Do you realize that if you change it there, the change will be made to all variants and not just one of them, don't you?
LucaMs Expert Licensed User Longtime User Apr 18, 2017 #4 jaraiza said: Do you realize that if you change it there, the change will be made to all variants and not just one of them, don't you? Click to expand... No, I cannot understand ... maybe I'm one of those dumb people. But I try again: set the hint by code, checking the orientation (If 100%x < 100%y Then "portrait") Upvote 0
jaraiza said: Do you realize that if you change it there, the change will be made to all variants and not just one of them, don't you? Click to expand... No, I cannot understand ... maybe I'm one of those dumb people. But I try again: set the hint by code, checking the orientation (If 100%x < 100%y Then "portrait")
Erel B4X founder Staff member Licensed User Longtime User Apr 18, 2017 #5 The hint text will be the same for all variants (tip: avoid using many variants). You will need to set it in the code. You can use GetDeviceLayoutValues.ApproximateScreenSize to decide how to set it. Upvote 0
The hint text will be the same for all variants (tip: avoid using many variants). You will need to set it in the code. You can use GetDeviceLayoutValues.ApproximateScreenSize to decide how to set it.
jaraiza Active Member Licensed User Longtime User Apr 18, 2017 #6 LucaMs said: But I try again: set the hint by code, checking the orientation (If 100%x < 100%y Then "portrait") Click to expand... That's the point , I'm jut doing it by code with "LayoutValues" so I can determine if any size is equal or below 320px (horizontal or vertical). What I'm asking for is any way to do it through script variants: If I try to use "hint" property there, I get an error. Other properties are available, like Text, TextSize, etc. Last edited: Apr 18, 2017 Upvote 0
LucaMs said: But I try again: set the hint by code, checking the orientation (If 100%x < 100%y Then "portrait") Click to expand... That's the point , I'm jut doing it by code with "LayoutValues" so I can determine if any size is equal or below 320px (horizontal or vertical). What I'm asking for is any way to do it through script variants: If I try to use "hint" property there, I get an error. Other properties are available, like Text, TextSize, etc.
Erel B4X founder Staff member Licensed User Longtime User Apr 18, 2017 #7 jaraiza said: What I'm asking for is any way to do it through script variants Click to expand... It is not possible. Upvote 0
jaraiza said: What I'm asking for is any way to do it through script variants Click to expand... It is not possible.
Erel B4X founder Staff member Licensed User Longtime User Apr 18, 2017 #8 BTW, if the hint is important then you should use FloatLabeledEditText: https://www.b4x.com/android/forum/threads/floatlabelededittext-viewsex.64062/#content Upvote 0
BTW, if the hint is important then you should use FloatLabeledEditText: https://www.b4x.com/android/forum/threads/floatlabelededittext-viewsex.64062/#content
jaraiza Active Member Licensed User Longtime User Apr 18, 2017 #9 Erel said: BTW, if the hint is important then you should use FloatLabeledEditText: https://www.b4x.com/android/forum/threads/floatlabelededittext-viewsex.64062/#content Click to expand... Thanks Erel, I'll give it a try Upvote 0
Erel said: BTW, if the hint is important then you should use FloatLabeledEditText: https://www.b4x.com/android/forum/threads/floatlabelededittext-viewsex.64062/#content Click to expand... Thanks Erel, I'll give it a try