小编dan*_*anb的帖子

Xamarin.Android:你如何链接静态库?

我试图按照Xamarin的文档中的指示,在Xamarin.Android项目中链接一个包含C++代码的静态库(foo.a)."路径嗅探方法"和"项目文件中的Abi元素"方法似乎都不起作用.

使用任一方法,当我尝试调用库函数时,我得到未处理的异常:

I/mono( 2591): [ERROR] FATAL UNHANDLED EXCEPTION: System.EntryPointNotFoundException: ...
Run Code Online (Sandbox Code Playgroud)

我应该提一下,我使用我在这里描述的"附加mtouch参数"-cxx方法与我的Xamarin.iOS项目链接和调用这个库(为armv7,armv7s构建)没有问题.我的所有DLLImports都是相同的跨平台...

[DllImport(Import.lib, CallingConvention=CallingConvention.Cdecl )]
internal static extern IntPtr FooMethodName(args);
Run Code Online (Sandbox Code Playgroud)

那么,我错过了什么?

仅供参考:我使用的是Xamarin Studio 4.0.5(build 4),Xamarin.Android 4.6.4(商业版)

xamarin.android xamarin

7
推荐指数
1
解决办法
2203
查看次数

如何通过授权的access_token创建GoogleCredential?

我有一个像这样的OAuth2令牌...

{{
  "access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "expires_in": "3600",
  "refresh_token": "xxxxxxxxxxxxxxxxxx",
  "token_type": "Bearer",
}}
Run Code Online (Sandbox Code Playgroud)

我正在尝试创建一个DriveService对象...

Service = new DriveService(new BaseClientService.Initializer()
{
    HttpClientInitializer = credential,
    ApplicationName = "foo",
});
Run Code Online (Sandbox Code Playgroud)

(像这样?)

但是我显然没有正确执行此操作,并且在查找文档时遇到了麻烦。

当我尝试创建一个GoogleCredential传递给DriveService

GoogleCredential credential = GoogleCredential.FromJson(credentialAsSerializedJson).CreateScoped(GoogleDriveScope);
Run Code Online (Sandbox Code Playgroud)

我得到以下异常:

{System.InvalidOperationException:从JSON创建凭据时出错。无法识别的凭证类型。

我会完全以错误的方式解决这个问题吗?

(这是示例代码上下文

drive oauth-2.0 google-drive-api

3
推荐指数
1
解决办法
1606
查看次数

如何为MvxCollectionViewController提供页眉或页脚?

我试图从MvxCollectionViewController中提供页眉和页脚视图,我遇到了麻烦.通常,使用UICollectionViewController,我会覆盖GetViewForSupplementaryElement方法,如下所示:

public override UICollectionReusableView GetViewForSupplementaryElement (UICollectionView collectionView, NSString elementKind, NSIndexPath indexPath)
{
    var someHeaderOrFooterView = (HeaderOrFooterView) collectionView.DequeueReusableSupplementaryView (elementKind, elementId, indexPath);
    return someHeaderOrFooterView;
}
Run Code Online (Sandbox Code Playgroud)

MvxCollectionViewControllers似乎没有像UICollectionViewController那样获得GetViewForSupplementaryElement方法的委托回调.

是否有另一种方法使用MvxCollectionViewController指定CollectionView的页眉和页脚?

xamarin.ios mvvmcross xamarin uicollectionview

2
推荐指数
1
解决办法
2962
查看次数