У меня определено следующее всплывающее окно: < /p>
< /code>
CodeBehind: < /p>
public partial class SimplePopup : Popup
{
public SimplePopup()
{
InitializeComponent();
}
public SimplePopup(string message, string messagetype)
{
InitializeComponent();
TheMessage.Text = message;
if (messagetype == "ERROR")
{
TheMessage.BackgroundColor = Colors.Red;
} else if (messagetype == "INFO")
{
TheMessage.BackgroundColor = Colors.Green;
}
}
async void OnOKButtonClicked(object? sender, EventArgs e)
{
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5));
await CloseAsync(token: cts.Token);
}
}
< /code>
Код для выполнения этого всплывающего окна: < /p>
public async Task DisplayPopup(string message, string messageType)
{
SimplePopup popup = new(message, messageType)
{
CanBeDismissedByTappingOutsideOfPopup = false
};
await MainThread.InvokeOnMainThreadAsync(async () =>
{
await this.ShowPopupAsync(popup, null);
});
}
< /code>
Я пробовал несколько методов, чтобы получить сообщение, чтобы заполнить всю область всплывающего окна, но до сих пор ничего не работает. Что я делаю не так?>
Подробнее здесь: https://stackoverflow.com/questions/797 ... rea-on-ios