Android Instance-no longer displays problems after processing hidden IME (xe8+ Xiaomi 2)

Source: Internet
Author: User

Results:

1. You can handle the problem again, but the downside is that each control has to be processed once and tired. Which great God has a good way of handling, please M me.

Instance code:

1 UnitUnit1;2 3 Interface4 5 uses6 system.sysutils, System.types, System.uitypes, system.classes, System.variants,7 FMX. Types, FMX. Controls, FMX. Forms, FMX. Graphics, FMX. Dialogs, Fmx.comboedit,8 FMX. Edit, FMX. EditBox, FMX. Numberbox, FMX. Datetimectrls, FMX. Scrollbox,9 FMX. Memo, FMX. Controls.presentation, Fmx.stdctrls,TenFMX. VirtualKeyboard,//need to introduce OneFMX. Platform,//need to introduce A FMX. Layouts; -  - type theTForm1 =class(Tform) - Vertscrollbox1:tvertscrollbox; - layout1:tlayout; - Memo1:tmemo; + Label1:tlabel; - Button1:tbutton; + Edit1:tedit; A Edit2:tedit; at     procedureformcreate (sender:tobject); -     procedureformfocuschanged (sender:tobject); -     procedureFormvirtualkeyboardhidden (sender:tobject; -Keyboardvisible:boolean;Constbounds:trect); -     procedureFormvirtualkeyboardshown (sender:tobject; -Keyboardvisible:boolean;Constbounds:trect); in     procedureEdit2click (sender:tobject); -   Private to     //defining Input Method variables + Fservice:ifmxvirtualkeyboardtoolbarservice; - FSERVICE_KB:FMX. Virtualkeyboard.ifmxvirtualkeyboardservice; the     {Private Declarations} *    Public $     {Public Declarations}Panax Notoginseng   End; -  the var + Form1:tform1; A  the Implementation +  - {$R *.FMX} $ {$R *. NMXHDPIPH.FMX ANDROID} $ //If you click Edit again, you should make a reflection - procedureTform1.edit2click (sender:tobject); - begin the   ifTedit (Sender). IsFocused andAssigned (FSERVICE_KB) Then -   TryWuyi fservice_kb. Showvirtualkeyboard (Tedit (Sender)); the   except -   End; Wu End; -  About proceduretform1.formcreate (sender:tobject); $ begin -   //control the operation of the virtual keyboard - TPlatformServices.Current.SupportsPlatformService (Ifmxvirtualkeyboardservice, - IInterface (fservice_kb)); A   ifTPlatformServices.Current.SupportsPlatformService +(Ifmxvirtualkeyboardtoolbarservice, IInterface (Fservice)) Then the   begin - fservice.settoolbarenabled (true); $ fservice.sethidekeyboardbuttonvisibility (true); the   End; the End; the  the End.

Android Instance-no longer displays problems after processing hidden IME (xe8+ Xiaomi 2)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.