MonoDroid GetSpans last parameter

回眸只為那壹抹淺笑 提交于 2019-12-10 14:55:19

问题


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:


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



来源:https://stackoverflow.com/questions/16522903/monodroid-getspans-last-parameter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!