改变大小 &UWP RatingControl 的间距 [英] Change size & spacing of UWP RatingControl

查看:26
本文介绍了改变大小 &UWP RatingControl 的间距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个新的RatingControl 在 UWP 中,允许您将评级显示为一系列星星.我想知道如何改变星星的大小以及它们之间的间距.

There's a new RatingControl in UWP that allows you to show ratings as a series of stars. I was wondering how I can change the size of the stars and also the spacing between them.

FontSize 不像在用于 UWP 的 Telerik 版本上那样工作.

FontSize does not work like it did on the Telerik version for UWP.

我希望这在不重新设计整个控件的情况下是可能的.例如,Microsoft 明确声明间距自定义"作为一项功能:

I hope this is possible without restyling the whole control. For example, Microsoft explicitly states "Spacing customization" as a feature:

评级控件有许多可以使用的附加功能.可以在我们的 MSDN 参考文档中找到使用这些功能的详细信息.以下是不完整的附加功能列表:

The rating control has many additional features which can be used. Details for using these features can be found in our MSDN reference documentation. Here is a non-comprehensive list of additional functionality:

  • 出色的长列表性能
  • 紧凑的尺寸,适用于紧凑的 UI 场景
  • 持续的价值填充和评级
  • 间距定制
  • 禁用成长动画
  • 自定义星数

推荐答案

如果不想编辑控件模板,一个快捷的方法是使用 ViewBox 容器来承载 RatingControl,您可以通过调整ViewBox的大小来调整RatingControl的大小.

If you don't want to edit the control template, a quick way is to use ViewBox container to host the RatingControl, you can resize the RatingControl by resizing the ViewBox.

<ViewBox Width="" Height="">
    <RatingControl .../>
</ViewBox>

这篇关于改变大小 &amp;UWP RatingControl 的间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆