修正 Memo 設定為 ReadOnly 後, 無法有複製的功能

问题:当 Memo 設定為 ReadOnly = True 後, 选取一段文字后,無法有複製的功能。

适用:XE6 Android 系统(目前 iOS 还找不到方法)

修正方法:

请将源码 FMX.Platform.Android.pas 复制到自己的工程目录里,再进行修改。

找到 TWindowManager.ShowContextMenu 函数,删除一行,如下:

procedure TWindowManager.ShowContextMenu(const ItemsToShow: TContextMenuItems);
begin

  ..... 省略 ......

    PlatformAndroid.SynchronizeOnUIThread(
      procedure
      begin
        if FCopyButton <> nil then
          FContextButtonsLayout.addView(FCopyButton);
        if FCutButton <> nil then
          FContextButtonsLayout.addView(FCutButton);
        if FPasteButton <> nil then
          FContextButtonsLayout.addView(FPasteButton);
//  if TVirtualKeyboardState.Visible in VirtualKeyboardAndroid.VirtualKeyboardState then // 删除这一行
          DoShowContextMenu;
      end);
  end;
end;

 

posted @ 2014-06-19 11:50  龟山Aone  阅读(815)  评论(0编辑  收藏  举报