問題:當 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;