Xamarin表格刷卡左/右轻扫手势 [英] Xamarin Forms Swipe Left/Swipe Right Gestures

查看:485
本文介绍了Xamarin表格刷卡左/右轻扫手势的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过说我完全新的移动开发前言本,Xamarin,C#.NET。

I want to preface this by saying i'm completely new to mobile development, Xamarin, C#, .Net.

我正在创建移动应用程序使用Xamarain表格,并碰上不具有滑动手势提供给我,至少根据我看过的文件的问题。

I'm working on creating a mobile app using Xamarain Forms and have run into the problem of not having the swipe gesture available to me, at least according to the documentation I've seen.

我发现这个网站:的http:// arteksoftware .COM /手势识别与 - xamarin表单/

本介绍如何添加一些额外的手势IOS / Android版是在形式访问上下文。之前,我尝试按照这一点,我想看看是否有人在Xamarin实施刷卡窗体应用程序,以及他们如何去了解它。

This describes how to add some additional gestures for IOS/Android to be accessible in the forms context. Before I try to follow this, I wanted to see if anyone else has implemented swipe in a Xamarin Forms app and how they went about it.

我的目标是为了有是水平堆栈布局。此布局包含7个按钮,每个按钮反映在当前周一天。向左滑动堆栈布局将改变按钮的文本前一周。向右滑动会改变按钮的文本到下周。

My goals are for there to be a horizontal stack layout. This layout contains 7 buttons, each button reflects a day in the current week. Swiping left on the stack layout will change the buttons text to the previous week. Swiping right will change the buttons text to the next week.

所以我也尝试使用MVVM这和XAML。因此,有可能是我离开了刷卡和向右滑动,动作分开?我想用ICommand的传递一定的参数基础上,刷卡的方向的功能。

So i'm also trying to use MVVM for this and XAML. So is it possible for me to separate the swipe left and the swipe right action? I want to use ICommand to pass a certain parameter to a function based on the direction of the swipe.

本或任何通知的任何例子将不胜感激。

Any examples of this or any advice would be greatly appreciated.

推荐答案

如果您熟悉的第三方库支付(和你使用Xamarin形式,所以这是一个很好的可能性), MR.Gestures 支持所有手感上全部进行Xamarin.Forms意见手势。我已经成功地使用它,并一直与它真的很高兴。它的成本非常合理的10€并具有出色的文档。

If you're comfortable with paying for a third-party library (and you're using Xamarin Forms, so that's a good possibility), MR.Gestures supports all touch gestures on all Xamarin.Forms Views. I've used it successfully and been really happy with it. It costs a very reasonable €10 and has excellent documentation.

如果你是很多人谁感到失望的是触摸手势并非Xamarin形式的支持之一,考虑的这个建议在UserVoice的

If you're one of the many people who are disappointed that touch gestures aren't supported in Xamarin Forms, consider voting for this suggestion at UserVoice.

这篇关于Xamarin表格刷卡左/右轻扫手势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆