XE7 Android 中使用 MessageDlg 范例


  MessageDlg('Choose a button:', System.UITypes.TMsgDlgType.mtInformation,
    [
      System.UITypes.TMsgDlgBtn.mbYes,
      System.UITypes.TMsgDlgBtn.mbNo,
      System.UITypes.TMsgDlgBtn.mbCancel
    ], 0,
    procedure(const AResult: TModalResult)
    begin
      if AResult = mrYES then
         ShowMessage('You chose Yes') else
      if AResult = mrNo then
         ShowMessage('You chose No') else
      if AResult = mrCancel then
         ShowMessage('You chose Cancel');
    end);

 

InputQuery('Input', ['Name'], [''],
  procedure(const AResult: TModalResult; const AValues: array of string)
  begin
    if AResult = mrOk then
      Showmessage(AValues[0]);
  end);

更新:

下面代碼 Android 實機沒問題,但在 iOS 實機沒有動作。

MessageDlg('Choose a button:', System.UITypes.TMsgDlgType.mtInformation, mbOKCancel, 0,
  procedure(const AResult: TModalResult)
  begin
       if AResult = mrOk then
          ShowShareSheetAction1.ExecuteTarget(Sender); // iOS 實機沒有動作 (沒有當機)
  end);

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM