質問

I've faced with problem yesterday. I want to use System.Drawing.Color structure in Android and iOS projects. Xamarin documentation claims that MonoTouch framework has System.Drawing.Color structure (link - http://iosapi.xamarin.com/?link=T:System.Drawing.Color). But in monotouch.dll namespace System.Drawing hasn't structure with name Color. enter image description here

What did I do wrong?

役に立ちましたか?

解決

Add a reference to the OpenTK library and you'll have System.Drawing.Color available. The doc you linked was indicating it:

doc screenshot

To add a reference: double click on Reference in your project, and under the **All* tab, select OpenTK,

他のヒント

It clearly states "System.Drawing.Color Structure", i.e. not namespace. This means you cannot do something like "using System.Drawing.Color;" in C#.

For all your color needs in iOS, you need to use MonoTouch.UIKit.UIColor, the type that MonoTouch uses in most cases (e.g. all the UIKit API).

I am not sure for Android, but I guess you need to use Android.Graphics.Color

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top