使用TNotificationCenterand創建通知時TNotification,它只會出現在通知抽屜中,不會像 WhatsApp msg 通知那樣彈出迷你浮動框。是否有任何屬性可以實作這一點?
uj5u.com熱心網友回復:
您需要創建一個重要性為 High 的頻道,并使用該頻道的 id 發送通知(通過通知的 ChannelId 屬性)。設定通道的示例代碼:
procedure TForm1.SetupNotificationChannel;
var
LChannel: TChannel;
begin
LChannel := NotificationCenter.CreateChannel;
try
LChannel.Id := 'MyChannel';
LChannel.Title := LChannel.Id;
LChannel.Importance := TImportance.High;
NotificationCenter.CreateOrUpdateChannel(LChannel);
finally
LChannel.Free;
end;
end;
NotificationCenter是一個TNotificationCenter組件
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/396931.html
標籤:德尔福 火猴 delphi-10.4-悉尼
