如何显示“x 的二次方”在 UILabel 中?

发布于 2024-09-05 02:27:54 字数 57 浏览 5 评论 0原文

我想在 UILabel 中显示“x2”(“x”的二次方)。我该怎么做呢?

提前致谢!

I want to display "x2" (second power of "x") in a UILabel. How can I do it?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

很快妥协 2024-09-12 02:27:54

有一个 Unicode 字符 0x00b2 (²,上标二)可以解决这个问题。

There’s a Unicode character 0x00b2 (², superscript two) that should do the trick.

温柔嚣张 2024-09-12 02:27:54

事实上,我自己已经找到了答案,而且很简单。在IB中有“特殊字符”菜单,其中包含许多字符,包括“x”的二次方。然后,您只需单击标签,按 cmd+1 并将字符拖放到检查器窗口的“文本”字段中。

Actually, I've found the answer myself and it's really simple. In IB there's the "Special characters" menu, which contains lots of characters including second power of "x". Then you just click on the label, press cmd+1 and drag'n'drop the character into the "Text" field of the Inspector window.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文