iOS Question Question about the TextView Hint text.

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all.

I need your help with adding a hint to B4XView.
I added a TextView with designer and saved it as B4XView.

Then on Page1_Appear event I added this
B4X:
'Code module
#Region  Project Attributes
    #ApplicationLabel: JustTest
    #Version: 1.0.0
    'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
    #iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
    #iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
    #Target: iPhone, iPad
    #ATSEnabled: True
    #MinVersion: 11
    #ProvisionFile: EVVProfile.mobileprovision
    #PlistExtra: <key>UIFileSharingEnabled</key><true/>
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    Public App As Application
    Public NavControl As NavigationController
    Private Page1 As Page
  
    Private TextView1 As B4XView
    Private TextField1 As TextField
  
End Sub

Private Sub Application_Start (Nav As NavigationController)
    NavControl = Nav
    Page1.Initialize("Page1")
    Page1.RootPanel.LoadLayout("Page1")
    NavControl.ShowPage(Page1)

End Sub

Private Sub Page1_Resize(Width As Int, Height As Int)
  
End Sub

Private Sub Page1_Appear
    Try
      
        TextView1.EditTextHint="TextView1 Hint"
      
    Catch
        Log(LastException)
    End Try
End Sub

When I start my test app TextView1 there is no hint text.

What am I doing wrong?

I tried to use TextField and added Hint text with designer. It works but there is no option to align text vertically.

Please my project.

Thanks
 

Attachments

  • JustTest.zip
    168.8 KB · Views: 56
Last edited:

ibra939

Active Member
Licensed User
Longtime User
Try to change 20 for space:
TextView1.Editable = True
TextView1.Text = ""
TextView1.HintText = "Enter your text here"
TextView1.Padding = Array As Int(5, 20, 5, 5) ' (Left, Top, Right, Bottom)
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
Try to change 20 for space:
TextView1.Editable = True
TextView1.Text = ""
TextView1.HintText = "Enter your text here"
TextView1.Padding = Array As Int(5, 20, 5, 5) ' (Left, Top, Right, Bottom)
TextView doesn't have property HintText
 

Attachments

  • screen1.png
    screen1.png
    29.1 KB · Views: 57
Upvote 0
Top