RAD Studio 10.4.1 is now available! Learn more. Looking for discounts? Visit our Special Offers page!
News

RAD Studio10.2.2的新功能

10.2.2到现在已经出来一阵子了, 除了英巴各种介绍10.2.2的文件和影片之外, 大中华区也做过10.2.2的网络研讨会, 参加的朋友超过130. 前一阵子Delphi的产品经理Marco又发表了一篇blogo介绍10.2.2额外的一些功能:
 
 
其实10.2.2除了上面已经说明的更新之外, 尚有2个重要的更新一个是Android另一个是属于iOS.
先谈谈Android, 那就是10.2.2终于大致改正了键盘的bug, 这个bug主要的原因是FireMonkey在显示键盘之前没有取得正确的大小区域, 因此也造成后续键盘隐藏键后的其余bug.看看下面10.2.2和之前版本的差异, 10.2.2在示键盘之前先正确取得显示的区域大小, 再显示键盘:
 
10.2.2之前
10.2.2
procedure TVKListener.onVirtualKeyboardShown;
begin
 
  TThread.Synchronize(nil, procedure
  begin
    FKeyboardService.SetState(TVirtualKeyboardAndroid.TvkbState.Shown);
    FEvent.SetEvent;
  end);
end;
procedure TVKListener.onVirtualKeyboardShown;
begin
  WaitingForContentChanged(Self);
  TThread.Synchronize(nil, procedure
  begin
    FKeyboardService.SetState(TVirtualKeyboardAndroid.TvkbState.Shown);
    FEvent.SetEvent;
  end);
end;
 
所以这个烦恼了多个版本的bug终于修正了.

 

另外一个更强是属于iOS平台, 原本FireMonkey就支持手势功能, iOS平台上的双击手势有时会和LongTap分不太清楚
因此10.2.2 加入了双击手势的Recognizer,

    TInteractiveGesture.DoubleTap:

      begin

        DoubleTapRecognizer := TUITapGestureRecognizer.Alloc;

        DoubleTapRecognizer := TUITapGestureRecognizer.Wrap(DoubleTapRecognizer.initWithTarget(GetObjectID, sel_getUid(‘HandleDoubleTap:’)));

        DoubleTapRecognizer.setNumberOfTapsRequired(2);

        DoubleTapRecognizer.setDelegate(GetObjectID);

        View.addGestureRecognizer(DoubleTapRecognizer);

        DoubleTapRecognizer.release;

      end;

并且加入了新的处理双击手势的处理函式:

procedure TFMXViewBase.HandleDoubleTap(gestureRecognizer: UITapGestureRecognizer);

var

  TouchPoint: NSPoint;

begin

  if gestureRecognizer.state = UIGestureRecognizerStateEnded then

  begin

    TouchPoint := CorrectLocationInView(gestureRecognizer, View, Form);

    DblTap(TouchPoint.Y, TouchPoint.Y);

  end;

end;

 
 
其效果就是在10.2.2版的iOS平台上现在双击手势的处理比以前的版本更精确和迅速了.

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Learn More About Upgrading

Related posts
C++

What's New in the GetIt Package Manager - June 2020

C++

RAD Studio 10.4 Now Available, Learn More

C++NewsRAD Studio

Open for Business with 10.4! - May 2020 GM Update

C++DelphiNews

Embarcadero Open Source Project Sponsorship

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES