(转)简单实现UCWeb的新特性展示

本文介绍了一种在Windows Phone 7 (WP7) 应用中实现首次启动时展示新特性的方法。通过检查应用是否首次启动,并在首次启动时导航至新特性展示页面,提升了用户体验。文中提供了具体的代码实现。

     作为 WP7开发者开发的应用,能使用户在没有使用就能了解到本应用的特性。


如图所示,第一次加载会展示新特性.
以后直接转到主页面.
很简单.上代码.

  1. /// <summary>
  2.     /// 应用主页面
  3.     /// </summary>
  4.     public partial class MainPage : PhoneApplicationPage
  5.     {
  6.         // 构造函数
  7.         public MainPage()
  8.         {
  9.             InitializeComponent();
  10.             
  11.         }
  12.         protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
  13.         {
  14.              
  15.              if (WPHelper.IsFirstStart())
  16.             {//如果是第一次加载,跳到特性展示页面.
  17.                 NavigationService.Navigate(new Uri("/NewFeaturesShow/PanoramaPage1.xaml", UriKind.Relative));
  18.             }
  19.         }
  20.     }
复制代码
  1.     public class WPHelper
  2.     {
  3.         /// <summary>
  4.         /// 是否第一次启动
  5.         /// </summary>
  6.         /// <returns>true 为第一次启动</returns>
  7.         public static bool IsFirstStart()
  8.         {
  9.             IsolatedStorageSettings userSetting = IsolatedStorageSettings.ApplicationSettings;
  10.             try
  11.             {
  12.                 string isFirstStart = userSetting["isFirstStart"] as string;
  13.                 if (isFirstStart == "1")
  14.                 {
  15.                     return true;
  16.                 }
  17.                 else
  18.                 {
  19.                     return false;
  20.                 }
  21.             }
  22.             catch (System.Collections.Generic.KeyNotFoundException)
  23.             {
  24.                 userSetting.Add("isFirstStart", "0");
  25.                 return true;
  26.             }



  27.         }

  28.     }
复制代码
这里xaml里用的是Panorama而不是Pivot.
Pivot在滑动的时候会出现一个图片与图片之间的空白区域,如果背景是黑色.显得很突兀.

原文链接http://www.codewp7.com/forum.php?mod=viewthread&tid=801

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值