android - 从 Xamarin 应用程序引用 Android 库

标签 android xamarin

我现在正在将一段用 Java 编写的 native Android 应用程序转换为 Xamarin/C#。我被困在使用 AttributeSet 类的代码段(最初放置在 android.util 包中)。如何获取该引用作为我的 Xamarin 应用程序的一部分?

最佳答案

AttributeSet其实不是一个类,它是一个接口(interface)。在 Xamarin 中,它被相应地命名为 IAttributeSet。

Android.Util.IAttributeSet attrSet = Android.Util.Xml.AsAttributeSet(...

关于android - 从 Xamarin 应用程序引用 Android 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24104105/

相关文章:

java - 安卓单元测试 : How to mock a listener that is sent as argument to an asynchronous method?

ios - Xamarin.IOS:本地化不起作用

android - 在xml中设置样式

android - GIF 图片加载缓慢问题

ios - 使用通知,我可以在它发生之前检索方向更改

自上次使用相同代码构建以来,Xamarin iOS 应用程序大小增加了 60%

c# - 欧元货币字符不显示

javascript - 在 Xamarin 中从 C# 对象调用 JavaScript

android - 在 RelativeLayout 中居中

android - 如何构建一个 GreenDao 查询来加载通过 id 列表指定的所有项目?