簡體   English   中英

IOS Rad Studio 11 模態響應上的 InputQuery 已反轉

[英]InputQuery on IOS Rad Studio 11 Modal Response Reversed

我正在使用帶有更新 1 的 RAD Studio Delphi 11 版本 28.0.44500.8973 和 Windows 10 上的 PAServer 更新。

當我在 iOS 下使用TDialogServiceAsync.InputQuery()方法時,輸入查詢的模態響應是相反的。

當按下 OK 按鈕時,模態結果 ( AResult ) 為 2 ( mrCancel ) 並且結果響應不會更新。

當按下 Cancel 按鈕時,模態結果 ( AResult ) 為 1 ( mrOK ) 並返回結果響應。

這與它應該工作的方式完全相反。

在Android或Windows下使用該方法時,模態結果和響應正確。

這在 RAD Studio 10.4 中工作正常,我相信當我第一次安裝 RAD Studio 11 時工作正常。但是,我不得不重新加載 RAD Studio 11,所以我下載了包含補丁 1 的最新安裝,然后加載了 PA服務器補丁。

我已將代碼附加到一個演示行為的非常簡單的項目中。

除了 2017 年在 Windows 下“取消”按鈕不起作用的帖子之外,我還沒有找到任何關於此問題的帖子,但我很確定這與此無關。

只是想知道是否有其他人遇到同樣的問題,或者它是否來自我的安裝或設置。 我在我的開發筆記本電腦上復制了 RAD Studio 11 安裝,我遇到了同樣的問題。

我將代碼附加到一個非常簡單的項目中,該項目重新創建了該問題。

單元:

unit Unit1;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.DialogService.Async,
  FMX.Controls.Presentation, FMX.StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    chkFlipIOSResponse: TCheckBox;
    Label2: TLabel;
    Label3: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure OnInputQuery_Close(const AResult: TModalResult; const AValues: array of string);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.fmx}

procedure TForm1.Button1Click(Sender: TObject);
begin
  TDialogServiceAsync.InputQuery('Enter Text', ['Enter Text:'], [label1.Text], Self.OnInputQuery_Close)

end;

procedure TForm1.OnInputQuery_Close(const AResult: TModalResult; const AValues: array of string);
var Response: String;
begin
  Label2.Text := 'Modal Response = ' + IntToStr(AResult);

  Response := AValues[0];

{$IFDEF IOS}
  if AResult = 1 then
     Label3.Text := 'Cancel Button Pressed'
   else
     Label3.Text := 'OK Button Pressed';
{$ELSE}
  if AResult = 1 then
     Label3.Text := 'OK Button Pressed'
   else
     Label3.Text := 'Cancel Button Pressed';
{$ENDIF}

  Label1.Text := Response.Trim;
end;

end.

形式:

object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 282
  ClientWidth = 338
  FormFactor.Width = 320
  FormFactor.Height = 480
  FormFactor.Devices = [Desktop]
  DesignerMasterStyle = 0
  object Button1: TButton
    Position.X = 118.000000000000000000
    Position.Y = 190.000000000000000000
    TabOrder = 0
    Text = 'Button1'
    OnClick = Button1Click
  end
  object Label1: TLabel
    Position.X = -8.000000000000000000
    Position.Y = 145.000000000000000000
    Size.Width = 338.000000000000000000
    Size.Height = 17.000000000000000000
    Size.PlatformDefault = False
    TextSettings.HorzAlign = Center
    Text = 'Message Response'
    TabOrder = 3
  end
  object chkFlipIOSResponse: TCheckBox
    Position.X = 96.000000000000000000
    Position.Y = 24.000000000000000000
    Size.Width = 234.000000000000000000
    Size.Height = 19.000000000000000000
    Size.PlatformDefault = False
    TabOrder = 4
    Text = 'Flip IOS Response'
  end
  object Label2: TLabel
    Position.X = -8.000000000000000000
    Position.Y = 107.000000000000000000
    Size.Width = 338.000000000000000000
    Size.Height = 17.000000000000000000
    Size.PlatformDefault = False
    TextSettings.HorzAlign = Center
    Text = 'Modal Response'
    TabOrder = 2
  end
  object Label3: TLabel
    Position.Y = 75.000000000000000000
    Size.Width = 338.000000000000000000
    Size.Height = 17.000000000000000000
    Size.PlatformDefault = False
    TextSettings.HorzAlign = Center
    Text = 'Button Pressed'
    TabOrder = 1
  end
end

只是想知道是否有其他人遇到同樣的問題

是的,我看到幾個人報告了類似的問題。 我發現了幾個與之相關的質量門戶票:

RSP-11101:iOS 上的 InputQuery 的 ModalResult 值錯誤

RSP-37702:iOS 上的 InputQuery 結果問題

RSP-38143:iOS inputQuery 返回錯誤按鈕

RSP-38454:FMX:TDialogServiceAsync.InputQuery ModalResult 錯誤

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM