MonoDroid GetSpans last parameter

2019-06-21 19:47发布

I'm trying to use ISpannable in a Monodroid project but am having problems with GetSpans. What I'm ultimately after is a Rich Text editor such as at:

https://code.google.com/p/android-richtexteditor/source/browse/?r=4#svn/trunk/src/net/sgoliver

However, the Xamarin documentation for GetSpans isn't particularly helpful. The line I'm trying to convert from Java to C# is:

StyleSpan[] ss = s.getSpans(styleStart, position, StyleSpan.class);

However, I don't know what to pass for the last parameter as writing StyleSpan.class in C# gives a compile error of "} expected". What can I pass in to the last parameter to get all spans, or all spans of a particular type?

1条回答
Lonely孤独者°
2楼-- · 2019-06-21 20:14

The C# equivalent should be Java.Lang.Class.FromType(typeof(StyleSpan)).

查看更多
登录 后发表回答