简体   繁体   English

如何在Windows Phone 7中为“表单”字段标签设置样式?

[英]How to style “form” field labels in Windows Phone 7?

Is there any standards guidance on how to style field labels next to form fields in windows phone 7 silverlight applications? 关于如何在Windows Phone 7 Silverlight应用程序中的表单字段旁边设置字段标签样式的任何标准指南?

For example, let's say I have a StackPanel with the TextBlock label and a TextBox for data entry. 例如,假设我有一个带有TextBlock标签的StackPanel和一个用于输入数据的TextBox。 Currently I am using the default TextBlock Margin included in the PhoneTextSubtleStyle ("12,0,12,0"), and using a Margin of "0,-12,0,0" to push the TextBox up closer to the label: 目前,我正在使用PhoneTextSubtleStyle(“ 12,0,12,0”)中包含的默认TextBlock边距,并使用“ 0,-12,0,0”的边距将TextBox推近标签:

<StackPanel HorizontalAlignment="Left"> 
  <TextBlock VerticalAlignment="Center" Text="Name" Style="{StaticResource PhoneTextSubtleStyle}" /> 
  <TextBox Text="{Binding ItemName, Mode=TwoWay}" TextChanged="TextBox_TextChanged" VerticalAlignment="Center" Width="433" Margin="0,-12,0,0" /> 
</StackPanel> 

Note that the TextBox seems to have some internal padding of 12 pixels to the left and right, so that the TextBlock label and the TextBox control visually line up perfectly on the left. 请注意,TextBox似乎在左右两侧具有12个像素的内部填充,因此TextBlock标签和TextBox控件在视觉上在左侧完美对齐。

The problem is, I see existing apps with widely varying conventions for field label styling. 问题是,我看到现有的应用程序在字段标签样式方面的约定多种多样。 Some do not do the negative margin adjustment, like I have above. 像我上面所说的那样,有些不做负边距调整。 Some don't. 有些没有。 Some appear to override the label TextBlock Margin so that it is indented an additional 12 pixels on the left (ie "24,0,12,0" instead of the default "12,0,12,0"). 有些人似乎会覆盖标签TextBlock Margin,以便在左侧再缩进12个像素(即“ 24,0,12,0”,而不是默认的“ 12,0,12,0”)。 Some apps put the labels to the left of the fields themselves (I hate that). 一些应用程序将标签本身放在字段的左侧(我讨厌)。

Is there some standard design guidance on field labels in Windows Phone 7? Windows Phone 7中是否有关于字段标签的一些标准设计指南? I read through the design template PDF and could only determine that the field labels should be upper case on the first word (preferably only one word labels), and should NOT have a colon at the end. 我通读了设计模板PDF,只能确定字段标签的第一个单词应该是大写(最好只有一个单词标签),并且结尾不应该带有冒号。 I didn't see anything with regards to margins or alignment between the label and the field. 我没有看到关于标签和字段之间的边距或对齐的任何信息。

This may also be of interest 这可能也很有趣

“Fuel Tracker” Guidance Application – Drop 3 “燃油追踪器”制导应用程序–投稿3


Have not seen any such specific guidance. 尚未看到任何此类具体指导。 It's arguably something we might pay more attention to than general consumers. 可以说,这可能是我们比普通消费者更关注的事情。

You could always tweet @WPDesignTeam and see if they have any unpublished thoughts on it. 您可以随时发布@WPDesignTeam推文,看看他们是否对此有未发表的想法。 Or email somone on the team throught their blog to see if it's something they are/willing to think about. 或通过博客在团队中发送电子邮件,以查看是否是他们愿意/愿意考虑的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM