Android Question How to hide "cancel/confirm" buttons in a MultilineTextItem of the B4XPreferencesDialog?

ferliner

Member
Hello everyone, how can i hide the cancel and confirm buttons in a MultilineTextItem?
When entering text, it overlaps with them.
Thanks in advance.
 

udg

Expert
Licensed User
Longtime User
To avoid the "overlap" you could set a right padding of 60dip
B4X:
B4XFloatTextField1.TextField.As(EditText).Padding = Array As Int (0dip, 0dip, 60dip, 0dip)    'Right margin 60dip
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
how can i hide the cancel and confirm buttons in a MultilineTextItem?
This will work for you:
B4X:
For i = 0 To prefdialog.PrefItems.Size - 1
        Dim pi As B4XPrefItem = prefdialog.PrefItems.Get(i)
        If pi.ItemType= prefdialog.TYPE_MULTILINETEXT Then
            Dim ft As B4XFloatTextField = prefdialog.CustomListView1.GetPanel(i).GetView(0).Tag
            ft.lblClear.Left = -100dip   'hide the confirm and cancel icons
            ft.lblV.Left = -100dip
        End If
    Next
 
Upvote 0

ferliner

Member
Thanks Mahares, but it's not working... i tried something similar before with no success.
I am attaching a small project to show the issue
 

Attachments

  • Example.zip
    9.4 KB · Views: 112
Upvote 0

ferliner

Member
As you can see in the example, the line:

Dim ft As B4XFloatTextField = prefdialog.CustomListView1.GetPanel(i).GetView(0).Tag:

gives an error.
 
Upvote 0

ferliner

Member
I figured out... i was missing the fact that i have to show the dialog, to customlistview be populated.

B4X:
    Dim sf As Object = prefdialog.ShowDialog(Options1, "OK", "Cancelar")
    'Hide confirm/cancel icons from MultiLine items
    For i = 0 To prefdialog.PrefItems.Size - 1
        Dim pi As B4XPrefItem = prefdialog.PrefItems.Get(i)
        prefdialog.CustomListView1.AnimationDuration = 0
        If pi.ItemType = prefdialog.TYPE_MULTILINETEXT Then
            Dim pnl As B4XView = prefdialog.CustomListView1.GetPanel(i)
            Dim ft As B4XFloatTextField = pnl.GetView(0).Tag
            ft.lblClear.Left = -100dip
            ft.lblV.Left = -100dip
        End If
    Next
    Wait For (sf) Complete (Result As Int)

Many thanks to everyone.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…