C# 启动屏幕脚本动画后的Windows Phone将触摸事件委托给webview
这是我的飞溅图像。CordovaView是自定义的webviewC# 启动屏幕脚本动画后的Windows Phone将触摸事件委托给webview,c#,windows-phone-7,windows-phone-8,windows-phone,C#,Windows Phone 7,Windows Phone 8,Windows Phone,这是我的飞溅图像。CordovaView是自定义的webview public partial class MainPage : PhoneApplicationPage { public MainPage() { InitializeComponent(); PhoneApplicationService.Current.Activated += (s, e) =>
public partial class MainPage : PhoneApplicationPage
{
public MainPage()
{
InitializeComponent();
PhoneApplicationService.Current.Activated += (s, e) =>
{
Uri uri = new Uri("SplashScreen.png", UriKind.Relative);
StreamResourceInfo resourceInfo = Application.GetResourceStream(uri);
BitmapImage sImage = new BitmapImage();
sImage.CreateOptions = BitmapCreateOptions.None;
sImage.SetSource(resourceInfo.Stream);
Image splashImage = new Image();
splashImage.Source = sImage;
LayoutRoot.Children.Add(splashImage);
OnImageOpened(splashImage, null);
Debug.WriteLine(string.Format("Activated"));
};
}
private void OnImageOpened(object sender, RoutedEventArgs e)
{
var opacityAnimation = new DoubleAnimation
{
To = 0,
Duration = TimeSpan.FromSeconds(6)
};
Storyboard.SetTarget(opacityAnimation, (DependencyObject)sender);
Storyboard.SetTargetProperty(opacityAnimation, new PropertyPath(Image.OpacityProperty));
var storyboard = new Storyboard();
storyboard.Children.Add(opacityAnimation);
storyboard.Begin();
}
}
上面是我的代码。当我启动应用程序时,会显示启动屏幕并淡出。我将触摸webview上的HTML页面按钮
当我按下电源按钮时,显示屏将关闭,手机将进入待机模式(未关闭),当我打开电源按钮并解锁屏幕时,屏幕上会显示闪屏并成功淡出,同时会显示我的网络视图。但当我触摸webview上的html按钮时,没有任何动作发生。如何将事件发送到webview?请格式化您的代码。我认为您的问题与使用语句或注释掉的代码无关。请删除它,使其更易于阅读我已删除注释的代码。。。
<Image x:Name="splashImage" HorizontalAlignment="Center" VerticalAlignment="Center" Source="SplashScreen.png" ImageOpened="OnImageOpened"></Image>
<my:CordovaView HorizontalAlignment="Stretch"
Margin="0,0,0,0"
x:Name="CordovaView"
VerticalAlignment="Stretch"
Background="Transparent"
StartPageUri="/www/default/index.html"
VerticalContentAlignment="Center"/>