我遇到了同样的问题并找到了一个简单的解决方法:只需确保创建顺序是您的 Tab 键顺序。您可以通过编辑(文本)表单文件 (.fmx) 来做到这一点。 (在表单设计模式下按 F12)
例如:
如果您有一个只有 3 个编辑控件的表单,则 for 看起来像这样:
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 154
ClientWidth = 215
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [dkDesktop, dkiPhone, dkiPad]
DesignerMobile = False
DesignerWidth = 0
DesignerHeight = 0
DesignerDeviceName = ''
DesignerOrientation = 0
DesignerOSVersion = ''
object Edit1: TEdit
Touch.InteractiveGestures = [igLongTap, igDoubleTap]
TabOrder = 0
Position.X = 40.000000000000000000
Position.Y = 88.000000000000000000
Width = 100.000000000000000000
Height = 22.000000000000000000
KillFocusByReturn = False
end
object Edit2: TEdit
Touch.InteractiveGestures = [igLongTap, igDoubleTap]
TabOrder = 1
Position.X = 40.000000000000000000
Position.Y = 56.000000000000000000
Width = 100.000000000000000000
Height = 22.000000000000000000
KillFocusByReturn = False
end
object Edit3: TEdit
Touch.InteractiveGestures = [igLongTap, igDoubleTap]
TabOrder = 2
Position.X = 40.000000000000000000
Position.Y = 24.000000000000000000
Width = 100.000000000000000000
Height = 22.000000000000000000
KillFocusByReturn = False
end
end
Tab 顺序为 Edit1:、Edit2:、Edit3:
如果你把它改成:
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 154
ClientWidth = 215
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [dkDesktop, dkiPhone, dkiPad]
DesignerMobile = False
DesignerWidth = 0
DesignerHeight = 0
DesignerDeviceName = ''
DesignerOrientation = 0
DesignerOSVersion = ''
object Edit1: TEdit
Touch.InteractiveGestures = [igLongTap, igDoubleTap]
TabOrder = 0
Position.X = 40.000000000000000000
Position.Y = 88.000000000000000000
Width = 100.000000000000000000
Height = 22.000000000000000000
KillFocusByReturn = False
end
object Edit3: TEdit
Touch.InteractiveGestures = [igLongTap, igDoubleTap]
TabOrder = 2
Position.X = 40.000000000000000000
Position.Y = 24.000000000000000000
Width = 100.000000000000000000
Height = 22.000000000000000000
KillFocusByReturn = False
end
object Edit2: TEdit
Touch.InteractiveGestures = [igLongTap, igDoubleTap]
TabOrder = 1
Position.X = 40.000000000000000000
Position.Y = 56.000000000000000000
Width = 100.000000000000000000
Height = 22.000000000000000000
KillFocusByReturn = False
end
end
比tab顺序是Edit1:,Edit3:,Edit2:不管TabOrder属性的值是什么