windows phone中,实现systemtray触摸后可见,几秒后消失的效果

<phone:PhoneApplicationPage 
    x:Class="ewlan.PivotMainPage"
    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:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
//只需要在需要修改的PAGE
//对应的XAML中,添加以下代码
    shell:SystemTray.IsVisible="True"
    shell:SystemTray.Opacity="0"
    shell:SystemTray.ForegroundColor="Orange"
    >

这里简单讲一下这关键的三个属性:

  • IsVisible 决定是否显示systemtray
  • ForegroundColor 前景色,决定systemtray的颜色,如右图,就是白色
  • 最关键的,Opacity,意思是透明度,这个属性一旦设置,systemtray便不会再占据你所设计页面的区域了,而是像平时我们使用WP手机那样,手指触摸后出现

怎么样?这样的设计就不会因为systemtray的固定占据而显得呆板了

想了解更多?点我

posted @ 2013-04-09 21:17  金靴欧文  阅读(152)  评论(0编辑  收藏  举报