首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么Windows8Phone Flick手势只在屏幕的上半部分工作?

为什么Windows8Phone Flick手势只在屏幕的上半部分工作?
EN

Stack Overflow用户
提问于 2013-10-29 19:11:05
回答 2查看 1.6K关注 0票数 1

我成功地在我的flick (又名slideswipe)的Windows 8 Phone App上按照在这个岗位上指令实现了这个手势,但出于某种原因,它只在屏幕的上半部分被识别。

我在模拟器和实际的开发设备(Nokia Lumia 520)上尝试了这一点,并得到了相同的结果。

我的应用程序正在使用ApplicationBar,这个闪烁的手势巧合地开始识别ApplicationBar天桥结束的运动(完全扩展)。

监听手势的图像也有一个tap事件,该事件在整个图像(屏幕的上/下半部分)中工作得很好。

提前谢谢..。

编辑:这是一些代码,我尝试通过创建一个空白页,但仍然没有任何运气。识别"FLICK“手势的区域被限制在手机屏幕的左上方(无论是在模拟器中还是在实际设备中)。

这是我的代码(CS):

FlickTest.xaml.cs

代码语言:javascript
复制
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代码:

代码语言:javascript
复制
   <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>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-11-17 04:43:04

在经历了很多痛苦之后,问题在于Windows 有一个已知的问题,它不能在横向模式(见此条目)中工作。

所以在这段时间里,在解决问题的同时,我正在寻找其他的选择.

票数 1
EN

Stack Overflow用户

发布于 2014-02-27 15:26:13

只是遇到了这个问题。GestureListener在横向模式下不工作(正如alejandrormz所写)。:(

但是,我有一个在操作和手势事件中内置的解决方案->。*易于实施。最佳示例代码:GitHub

希望这能有所帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19667123

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档