Hello,
I cannot get the vertical scroll action in the edited (see: Description) field.
Actually, I can only scroll the whole dialogue view: PrefDialog.
I have included a short source:
I cannot get the vertical scroll action in the edited (see: Description) field.
Actually, I can only scroll the whole dialogue view: PrefDialog.
I have included a short source:
SetFloatTextField:
Private Sub SetFloatTextField(FloatTextField As B4XFloatTextField, SmallLabelTextSize As Int, LargeLabelTextSize As Int,TextSize As Int, SmallLabelGravityLeft As Int)
FloatTextField.SmallLabelTextSize = SmallLabelTextSize 'Hint Small
FloatTextField.LargeLabelTextSize = LargeLabelTextSize 'Hint Large
FloatTextField.TextField.TextSize = TextSize 'Text
Dim TextFont As B4XFont = xui.CreateFont2(FloatTextField.HintFont, FloatTextField.SmallLabelTextSize)
Dim TextWidth As Int = MeasureTextWidth(FloatTextField.HintText, TextFont)
Dim BorderRadius As Int = 0
FloatTextField.HintLabelSmallOffsetY = 3 'Inside
If SmallLabelGravityLeft = Gravity.RIGHT Then
FloatTextField.HintLabelSmallOffsetX = (FloatTextField.TextField.Width - TextWidth) - (BorderRadius + 5) 'Right
FloatTextField.lblClear.Left = (FloatTextField.TextField.Width - TextWidth) - (BorderRadius + 5) - 60dip
FloatTextField.lblV.Left = (FloatTextField.TextField.Width - TextWidth) - (BorderRadius + 5) - 25dip
Else
FloatTextField.HintLabelSmallOffsetX = 0dip 'Left
End If
FloatTextField.Update
FloatTextField.TextField.SetColorAndBorder(xui.Color_White, DipToCurrent(2), xui.Color_Transparent, BorderRadius)
FloatTextField.lblV.Top = FloatTextField.lblV.Top - 17dip
FloatTextField.lblClear.Top = FloatTextField.lblClear.Top - 17dip
Private ed As EditText = FloatTextField.TextField
ed.Gravity = Gravity.TOP + Gravity.LEFT
ed.SingleLine = False
FloatTextField.Update
End Sub
Private Sub MeasureTextWidth(t As String, f As B4XFont) As Float
Dim cvs As B4XCanvas
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, 2dip, 2dip)
cvs.Initialize(p)
Dim Width As Float = cvs.MeasureText(t, f).Width
Return Width
End Sub
...
Dim sf As Object = PrefDialog.ShowDialog(Item, "OK", Maps.L(23,"CANCEL"))
For i = 0 To PrefDialog.PrefItems.Size - 1
Private pi As B4XPrefItem = PrefDialog.PrefItems.Get(i)
If pi.ItemType = PrefDialog.TYPE_TEXT Then
Private ft As B4XFloatTextField = PrefDialog.CustomListView1.GetPanel(i).GetView(0).Tag
Private dp As Int = ft.lblV.Top - 17dip
ft.TextField.Font = xui.CreateDefaultBoldFont(14)
Select i
Case 6
PrefDialog.CustomListView1.GetPanel(i).GetView(0).Height = 1000dip 'Height TextField
PrefDialog.CustomListView1.ResizeItem(i, 200dip) 'Height PrefItems
SetFloatTextField(ft,14,16,14,Gravity.RIGHT) ' -------->>>>> how to get a field scrolled in edit?
Case Else
ft.lblClear.Top = dp: ft.lblV.Top = dp
End Select
End If
Next
Wait For (sf) Complete (Result As Int)
Last edited: