本文介绍了在xamarin中使用交错网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须在我的Xamarin android应用程序中使用交错网格视图。
我找到了很多带有本地代码的示例,但它们都使用本地库。
像
但我想在Xamarin中使用,那里是否有任何库或组件?或者有任何样本? 解决方案
)?大声笑!只是在开玩笑!
我有同样的问题,我认为你(我们)有几个选择(请在做出决定之前先阅读所有解决方案)
b
$ b
- 第一种解决方案是尝试绑定Java库,我的意思是从C#中使用.JAR。 Xamarin对此有非常好的文档()
- 其次可以将JAVA代码移植到C#。 Xamarin对此也有很好的文档()。我为iOS做了几次这样的C#(我在我的博客中写了几个关键词)。在这里你也有一个很好的阅读()
- 最后,您将看到我将遵循的本地解决方案。解决方案在此推文中() 。这里有一篇详细文章Xamarin Android - 通过RecyclerView交错网格布局,并且没有Java绑定! ()与所有源代码
我希望你找到这个有用的
来自阿根廷的问候
HERNAN
I have to use staggered grid view in my Xamarin android application.I have found many samples with native code, but they use native library.Like https://github.com/etsy/AndroidStaggeredGridhttps://github.com/maurycyw/StaggeredGridView
But I wanted to use in Xamarin, is there any library or component there or any sample?
解决方案
Did you try using Google (https://www.google.com/search?q=xamarin+AndroidStaggeredGrid&oq=xamarin+AndroidStaggeredGrid)? LOL! Just kidding!
I had the same problem and I think you (we) have several options (please read all the solutions first before making a decision)
- First solution is to try "Binding a Java Library", I mean consuming .JARs from C#. Xamarin has a really good documentation for this (http://developer.xamarin.com/guides/android/advanced_topics/java_integration_overview/binding_a_java_library_(.jar)/)
- Second could be porting the JAVA code to C#. Xamarin also has good doc for this (http://developer.xamarin.com/guides/android/advanced_topics/java_integration_overview/porting_java_to_csharp/). I did this several times for iOS to c# (I wrote several articules in my blog http://www.hernanzaldivar.com). You have TOOLS TO HELP YOU CONVERT JAVA TO C# SOURCE CODE (http://codecall.net/2014/03/27/best-tools-to-convert-java-to-c-source-code/). Here you also have a good read for this (http://blog.xamarin.com/android-in-c-sharp/)
- Finally, you have this native solution that I'm going to follow. The solution is in this tweet (https://twitter.com/kphillpotts/status/576130296338321408). Here you have a detail article "Xamarin Android - A Staggered Grid Layout, via a RecyclerView. And no Java bindings!" (http://blog.wislon.io/posts/2015/03/05/xamarin-android-staggered-grid-layout/) with all the source code
I hope you find this usefulGreetings from ArgentinaHERNAN
https://twitter.com/vackuphttp://www.hernanzaldivar.com/
这篇关于在xamarin中使用交错网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!