【问题标题】:Applcation bar buttons with text in WPWP中带有文本的应用程序栏按钮
【发布时间】:2012-09-14 04:29:26
【问题描述】:

当用户单击“...”时,我的应用程序栏带有一些按钮和菜单项。无论如何,我意识到有些图标的含义乍一看很难理解。

有什么方法可以在图标下方显示带有文字的图标吗?当然,当用户单击“...”时它们是可见的,但对于菜单项也是可见的,我不想要它。

有人这样做吗?

【问题讨论】:

  • 违背既定 UI 行为的原因是什么?它所做的是用户合理预期的事情。
  • 好吧,有时那里的图标可能对用户没有明确的意义。

标签: windows-phone-7 expression-blend application-bar


【解决方案1】:

你不能用标准的ApplicationBar 做到这一点。正如我所说的default dehaviour 是隐藏文本。

另外 WP7 用户有特殊的用户体验,所以如果他不能理解你的图标的含义,他会按“...”来阅读文字。

但您可以在某些场景中模拟应用栏:

<Border Background="{some gray color from phone resources}">
 <StackPannel Orientation="Horisontal">
  <Button Content={Binding TextB} Command="{Binging CommandA}" 
                          Style="{your appbar-like template}"/>
  <Button Content={Binding TextB}  Command="{Binging CommandB}" 
                          Style="{your appbar-like template}"/>
</StackPannel>
</Border>

将其放在页面底部。但是要准备好花费大量时间来模拟标准的 appbar 行为。我认为这不是一个好主意。

【讨论】:

  • 我同意你的观点,但很多时候我从非 wp 的人那里得到了关于这个的问题,他们有点惊讶“...”会向他们展示更多。对我来说这也是正常的事情。感谢您的建议:)
【解决方案2】:

您可以简单地使用 shell:ApplicationBar 并设置 Text 属性

<shell:ApplicationBar x:Name="dialogsPageAppbar">
        <shell:ApplicationBarIconButton  IconUri="/images/Icons/appbar.add.rest.png" Text="create"/>
        <shell:ApplicationBarIconButton  IconUri="/images/Icons/appbar.refresh.rest.png" Text="refresh"/>
        <shell:ApplicationBarIconButton  IconUri="/images/Icons/appbar.feature.search.rest.png" Text="search"/>
        <shell:ApplicationBar.MenuItems>
            <shell:ApplicationBarMenuItem Text="settings" />
        </shell:ApplicationBar.MenuItems>
    </shell:ApplicationBar>

【讨论】:

  • 这是用文本制作按钮的正常方式,但是当用户单击“...”时会出现文本。在默认视图中,您只有一个没有文字的地铁图标。我希望看到下面带有文本的图标作为默认视图
  • 如果您不需要本地化您的应用 - 绘制一个带有文本的图标。
  • 无论如何,这里是默认行为msdn.microsoft.com/en-us/library/windowsphone/develop/…
  • @AntonSizikov 它装不下,即使它也很可能无法阅读
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-12-22
  • 1970-01-01
  • 1970-01-01
  • 2013-08-26
  • 1970-01-01
  • 1970-01-01
  • 2013-07-05
相关资源
最近更新 更多