Forum Cross Platform with Xamarin
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Code between #if __IOS__ shows up like it's commented out.

BasJansen.1375BasJansen.1375 NLMember

I'm developing an app for iOS and Android and I want specific pieces of code to only run for iOS or android. SO im using a condition to check if the device is an iOS device or an Android device.
But my code between the #if and #endif appears like it's commented out.
How can I resolve this since it makes the code pretty much unreadable and the indentation also doesn't work.


I am using Xamarin Studio 5.8 on Mac OS X 10.10.2


  • adamkempadamkemp USInsider, Developer Group Leader mod

    I'm guessing that the editor isn't aware of implicit/built-in defines. We use custom defines (configured in the project settings), and it works fine if you do that because the editor can know which ones are active.

Sign In or Register to comment.