Quantcast
Viewing all articles
Browse latest Browse all 51

Using Conditional Compilation in Xamarin Shared Project for iOS

There are times when you might want to perform an action that is specific to a device in the Xamarin Shared Project. For example , assume that you have to set the string named title within the Xaml page present in the Xamarin Shared Project only for iOS devices to a specific text, you can use the conditional compilation directive as shown below. string Title = ""; #if __IOS__ Title = "This is an iOS App"; #endif Where did we get this __IOS__ directive from ? Right click on the <AppName>.iOS project in the Solution Explorer and navigate to theImage may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 51

Trending Articles