wp7 的全屏网络浏览器控件 [英] Full screen web browser control for wp7

查看:25
本文介绍了wp7 的全屏网络浏览器控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Windows Phone 7 网络浏览器应用程序中,我编写了一个代码来隐藏文本框和应用程序栏.隐藏这些东西后,我需要 Web 浏览器控件进行拉伸并使其成为全屏 Web 浏览器.发生了一些奇怪的事情.如果我没有在 UrlTextBox 中输入任何内容并且如果我触摸了 Web 浏览器控件(当前它是空白的),Web 浏览器控件会拉伸到全屏(见图 1)但是如果我在 UrlTextBox 中输入了一些 URL(即导航到那个 URL),如果我触摸了 Web 浏览器控件(见图 2),它就不会扩展.下面的图片可以给你一些想法.

In my web browser app for windows phone 7, i wrote a code to hide textbox and application bar. After hiding these things, i need the web browser control to stretch and make it as a full screen web browser. There is some weird things happened. If i didn't type any into the UrlTextBox and if i touched the web browser control(currently it's blank), the web browser control stretches to full screen(see image 1) but if i typed some URL into the UrlTextBox(i.e, navigated to that URL) and if i touched the web browser control(see image 2), it doesn't getting expanded. The following images can give you some idea.

图 1-

图片 2-

下面的代码是用来隐藏上面的东西-

The following code is used to hide the above things-

  private void browsers_Focus(object sender, RoutedEventArgs e) 
  { 
  UrlTextBox.Visibility = Visibility.Collapsed; 
  Back.Visibility = Visibility.Collapsed; 
  Forward.Visibility = Visibility.Collapsed; 
  } 

我的 .xaml 页面-

My .xaml Page-

<Grid x:Name="LayoutRoot"> 
<Grid.RowDefinitions> 
    <RowDefinition Height="Auto" /> 
    <RowDefinition Height="*" /> 
</Grid.RowDefinitions> 
<TextBox x:Name="UrlTextBox" Background="White" InputScope="URL" 
     KeyDown="UrlTextBox_KeyDown" Margin="0,0,98,0" GotFocus="UrlTextBox_GotFocus" LostFocus="UrlTextBox_LostFocus" KeyUp="UrlTextBox_KeyUp"/> 
<Grid x:Name="BrowserHost"  
  Grid.Row="1" GotFocus="BrowserHost_GotFocus"> 
</Grid> 

我需要的是如果用户触摸浏览器控件,则浏览器控件应该拉伸到全屏".有人可以帮我解决这个问题吗?在此先感谢您的辛勤付出!

What i need is "If the user touches the browser control, then the browser control should stretch to full screen". Can anybody help me with this? Thanks in advance for your hard word!

推荐答案

您是否尝试过作为 Silverlight Toolkit 一部分的 GestureListener ?

Did you try the GestureListener that is part of Silverlight Toolkit ?

这篇关于wp7 的全屏网络浏览器控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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