It's a weird problem, there are many different type files on my list such as pdf, ppt, xls etc, everything works fine with them but some doc files are not displaying.
I use WebView, UIDocumentInteractionController, QLPreviewController to display the files but I have the same problem. Like this
When I use webview I have this screen
The files size are OK, i mean not too big and there is no problem while opening in computer. I tested the app in a real device, same problem..
Here is the similar problem and i think that there is a bug in ios as they said
How to manage memory within a QLPreviewController
But I believe that there should be a solution, is it a memory problem? I use Xamarin.iOS and this is my code
QLPreviewItemBundle prevItem = new QLPreviewItemBundle(info.FileName, info.FilePath);
QLPreviewController previewController = new QLPreviewController();
previewController.DataSource = new PreviewControllerDS(prevItem);
NavigationController.PushViewController(previewController, true);
and this is for UIDocumentInteractionController
var documentPath = docInfo.FilePath;
UIDocumentInteractionController interationController = UIDocumentInteractionController.FromUrl(NSUrl.FromFilename(documentPath));
interationController.Name = docInfo.FileName;
interationController.ViewControllerForPreview = (controller) => NavigationController;
interationController.DidEndPreview += (sender, e) =>
{
interationController.Dispose(); interationController = null;
};
InvokeOnMainThread(() => interationController.PresentPreview(true));