Windows Phone7程序控件使用Tilt(倾斜)效果
来源:互联网 发布:php采集源码 编辑:程序博客网 时间:2024/05/17 06:27
Windows Phone7 模拟器自带的settings等应用的列表等控件, 点击时有Tilt倾斜的效果, 我们自己写的Demo默认控件是没有这种效果,显得风格与系统不一致,查了一msdn,发现这种效果叫Tilt,并且官方有一个demo:
倾斜特效(Tilt Effect)示例
Windows Phone 控件的倾斜特效(Tilt Effect)为您在普通的控件交互中提供了更加丰富的可视化反馈。当控件被触摸时,它提供了一个“倾斜”状的反馈。控件倾斜特效示例展示了如何在一个应用程序当中实现这种倾斜特效。有关更多如何在应用程序中增加倾斜特效的更多信息,请查看Control Tilt Effect for Windows Phone。
下载示例
如何在自己的项目增加Tilt效果呢,可以看看这个
How to: Use the Control Tilt Effect for Windows Phone
其实就是以下几步:
1、在项目中增加 TiltEffect class ,可以从demo中直接复制文件
2、在xaml文件MainPage.xaml开头增加 红色的2句
<phone:PhoneApplicationPage
x:Class="HelloWorld.MainPage"
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:local="clr-namespace:ControlTiltEffect"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True"
local:TiltEffect.IsTiltEnabled="True">
3、如果某个控件不想要Tilt效果,则设置 local:TiltEffect.SuppressTilt="True"
例如
<Button Content="Button (Suppressed)" Height="150" HorizontalAlignment="Left" Margin="37,0,0,161" VerticalAlignment="Bottom" Width="380" local:TiltEffect.SuppressTilt="True"/>
挺简单吧,如果还是不清楚自己好好看官方的英文文档吧
- Windows Phone7程序控件使用Tilt(倾斜)效果
- 如何使用 Windows Phone 的控件倾斜效果
- Windows Phone 的控件倾斜效果
- Windows Phone7开发:输入控件
- Windows Phone7 开发 使用系统资源
- 一起学Windows Phone7开发:容器控件
- windows phone7 button控件背景问题
- 一起学Windows Phone7(十三.控件)
- 一起学Windows Phone7(十二.控件)
- 开发第一个Windows Phone7程序
- 噩梦5Tilt Shift (Lens Blur) 倾斜移位(镜头模糊)
- 【飞秋】一起学Windows Phone7开发(十三.二 按钮控件)
- 【飞秋】一起学Windows Phone7开发(十三.四 基本控件)
- 一起学Windows Phone7开发(十三.一 容器控件)
- 一起学Windows Phone7开发(十三.二 按钮控件)
- 一起学Windows Phone7开发(十三.三 输入控件)
- 一起学Windows Phone7开发(十三.四 基本控件)
- 一起学Windows Phone7开发(十二.一 容器控件)
- 二叉树基本操作c实现
- 什么是模板缓冲(Stencil Buffer)
- 遍历set容器时,不能修改容器元素的状态
- OpenGL 反锯齿的一些措施
- (转载)由1-7的随机整数函数构造1-10随机整数函数
- Windows Phone7程序控件使用Tilt(倾斜)效果
- 同步机制——互斥体锁、读/写锁、信号量锁、条件变量
- 各平台 SSH 免费客户端 SSH代理客户端
- Outlook 导入联系人(.CSV文件)
- 跟我学习InstallShield(1)
- 查看该目录下有几个文件夹几个文件的shell代码
- make package on mac
- 二叉排序树
- shell if 的一点体会