惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
V
Vulnerabilities – Threatpost
C
Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
Latest news
Latest news
T
Threatpost
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Tor Project blog
月光博客
月光博客
罗磊的独立博客
H
Help Net Security
Recent Announcements
Recent Announcements
L
Lohrmann on Cybersecurity
Know Your Adversary
Know Your Adversary
N
Netflix TechBlog - Medium
I
InfoQ
NISL@THU
NISL@THU
WordPress大学
WordPress大学
博客园_首页
IT之家
IT之家
GbyAI
GbyAI
小众软件
小众软件
C
Check Point Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cloudbric
Cloudbric
P
Proofpoint News Feed
J
Java Code Geeks
博客园 - 司徒正美
L
LINUX DO - 热门话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
S
Schneier on Security
博客园 - Franky
C
Cyber Attacks, Cyber Crime and Cyber Security
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
T
Tailwind CSS Blog
P
Privacy & Cybersecurity Law Blog
Engineering at Meta
Engineering at Meta
爱范儿
爱范儿
Project Zero
Project Zero
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
T
The Blog of Author Tim Ferriss
T
Tenable Blog

博客园 - WilsonWu

[Azure] 使用 Visual Studio 2013 管理中国版 Azure 订阅 [Azure] 使用 Azure 快速搭建 Redis 服务器 [Azure] Azure 中国服务使用注意事项及兼容版存储访问工具 [Visual Studio] 开启Visual Studio 2012通过右键菜单创建单元测试(Unit Test) [Azure] 创建支持Apache,PHP以及MySQL的CentOS Web Virtual Machine Server [Windows 8] 开发初体验:对话框(MessageBox)和程序任务栏(ApplicationBar) [Windows Phone] 为应用添加后台计划任务 – Scheduled Task Agent [Windows Phone] 在中文版Visual Studio 2010中开发Windows Phone应用程序 [VSTS] 让ADO.NET Entity Framework支持Oracle数据库 [VSTS] 配置 Team Foundation Server 团队权限最佳实践 [VSTS] 从零开始 Team Foundation Server 2010 安装配置详细图文教程 [Windows Phone] 在Windows Phone程序中播放GIF动画 [Windows Phone] Windows Phone 7 播放远程流媒体的代码实现方法 [Windows Phone] 在Windows Phone应用中使用Google Map替代Bing Map [免费讲座] 成都软件技术沙龙 - 开启基于Scrum的敏捷开发全新征程讲座 欢迎访问iOS开发者论坛:www.codeios.com! [TechEd 2010] 回首微软TechEd十年,我们获益良多! [.NET] 在Windows系统中搭建基于.NET的iPhone应用程序虚机开发环境 [Windows 7] 使用Windows Media Center看免费大片
[Windows Phone] 另类方法解决ScrollViewer设置透明度后文字模糊问题
WilsonWu · 2011-09-26 · via 博客园 - WilsonWu

最近在开发一些Windows Phone 7的应用,遇到了一些问题,比较奇怪的当属昨天遇到的了。

当我在ScrollViewer中放入一个TextBlock控件绑定文字,并设置ScrollViewer的透明度为非1.0(我设置0.7,比较好看),这时如果TextBlock中文字超出ScrollViewer的高度,也就是说可以上下滑动来看到更多文字,就会出现文字模糊的情况发生,如下图:

1231231231d

请教了多位朋友都说这可能是个Bug,于是Google了很久也没能找到解决方法,于是灵机一动用来一个另类的方法来解决,这个方法就是使用一个透明度为70%的1像素高1像素宽的PNG图片(下面代码中DesBackground.png既是)作为文字所在容器的背景,代码也很简单,如下,背景图我就不放了,自己用PS建一个很简单:

<StackPanel Margin="0,-20,0,80"> 
    <StackPanel.Background> 
        <ImageBrush ImageSource="Images\Countries\DesBackground.png"></ImageBrush> 
    </StackPanel.Background> 
    <ScrollViewer Height="553" VerticalAlignment="Top" Margin="10,10,10,10"> 
        <TextBlock x:Name="tbHistory" TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"></TextBlock> 
    </ScrollViewer> 
</StackPanel>

效果如下:

11111111

是不是很清晰?而且不影响美观!

这个方法对程序性能和存储的影响可忽略不计,个人认为还是比较好的,希望能帮助有需要的朋友!