0

I am creating an application using Xamarin.forms for multi-platform mobiles. When there is an error, the application shows a DisplayActionSheet that explains the error. But the error content is not shown full, but just half of the sentence.

How to make possible to show a long content of the error in a message shown by a DisplayActionSheet?

4

1 回答 1

0

This is not supported in Xamarin.Forms*. However, let's look at why.

Here is the code on iOS for DisplayActionSheet. It uses an UIAlertController and sets the title and message of that control. This is what you are seeing displayed. I could not find any documentation on what the actual character limit is for the title or message. It does seem to have one.

I think your best options are to create a custom dialog if you need to show very long text that is scrollable. You might also consider not showing long text like this and instead show a user-friendly message and log your error message a different way.

Note* You might be able to implement your own custom renderer for a similar method that displays a custom UIAlertController. However, I did see this in my research on how to customize it:

The UIAlertController class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified.

于 2016-07-22T17:01:15.790 回答