Custom Document Types
Using an Image as a Custom Document Type Icon in Xamarin.iOS.
- PDF for offline use
- Sample Code:
- Related Articles:
- Related SDKs:
Let us know how you feel about this
last updated: 2017-05
This article covers including and managing an image asset in a Xamarin.iOS app to be used as a Custom Document Type Icon.
If a Xamarin.iOS app supports loading a particular document type, the developer can provide icons that the system will use when it encounters that document type, such as when a user holds down an attachment in the Mail Application as shown here:
The developer can add document type information for a file format the app is capable of opening by including dictionary entries for the
CFBundleTypeName string and
LSItemContentTypes array in the app's
Info.plist. The icons for the document type go in the
CFBundleTypeIconFiles array. If a document icon isn't provided, iOS will derive one from the app icon.
Icons can be supplied for several sizes, optimized for the various device resolutions.
To assign these values in Xamarin Studio, use the Document Types section under the Advanced tab on the
editor to add the document type and assign image icons to it. For
example, here is a screenshot showing registration for PDF support:
To assign these values in Visual Studio, use the Document Types section under the Advanced tab on the
Click the Add Document Type button and fill in the required fields: