我成功地在我的flick (又名slide,swipe)的Windows 8 Phone App上按照在这个岗位上指令实现了这个手势,但出于某种原因,它只在屏幕的上半部分被识别。
我在模拟器和实际的开发设备(Nokia Lumia 520)上尝试了这一点,并得到了相同的结果。
我的应用程序正在使用ApplicationBar,这个闪烁的手势巧合地开始识别ApplicationBar天桥结束的运动(完全扩展)。
监听手势的图像也有一个tap事件,该事件在整个图像(屏幕的上/下半部分)中工作得很好。
提前谢谢..。
编辑:这是一些代码,我尝试通过创建一个空白页,但仍然没有任何运气。识别"FLICK“手势的区域被限制在手机屏幕的左上方(无论是在模拟器中还是在实际设备中)。
这是我的代码(CS):
FlickTest.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
namespace Windows_8_Phone_App
{
public partial class FlickTest : PhoneApplicationPage
{
public FlickTest()
{
InitializeComponent();
}
private void image_GestureListener_Flick(object sender, FlickGestureEventArgs e)
{
if (titulo.Text == "Foo")
{
titulo.Text = "Bar";
}
else {
titulo.Text = "Foo";
}
}
}
}和XAML代码:
<phone:PhoneApplicationPage
x:Class="Windows_8_Phone_App.FlickTest"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Landscape" Orientation="Landscape"
mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock x:Name="titulo" Text="page name" Margin="9,-7,0,0" />
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Image x:Name="imagen" HorizontalAlignment="Left" Height="309" Margin="10,0,0,0" VerticalAlignment="Top" Width="694" Source="/Assets/AppBar/basecircle.png" Stretch="Fill">
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener Flick="image_GestureListener_Flick" />
</toolkit:GestureService.GestureListener>
</Image>
</Grid>
</Grid>
</phone:PhoneApplicationPage>https://stackoverflow.com/questions/19667123
复制相似问题