如何在 iOS 上的按钮中显示带下划线的文本? [英] How to display Underlined Text in a Button on iOS?

查看:21
本文介绍了如何在 iOS 上的按钮中显示带下划线的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的视图中显示邮件 ID,这样点击邮件 ID 就会打开邮件编辑器视图.

I want to display the mail ID in my view such that clicking the mail ID should open the mail composer view.

我想将按钮文本显示为带下划线以显示它是一个超链接,并且按钮单击事件可以调用邮件编辑器视图.目前,我无法显示带下划线的按​​钮文本.

I want to display the button text as underlined to show it is a hyperlink and for the button click event to call the mail composer view. At present, I am not able to show the button text underlined.

我想在按钮上方放置一个标签并调整标签属性以获得带下划线的文本,但没有用.

I thought of placing a label above the button and adjusting the label property to get the underlined text but that did not work.

是否有不同的方式来获得我想要的外观和行为?

Is there a different way to get the appearance and behavior I want?

推荐答案

另一种选择是为按钮设置图像.创建一个显示适当文本的图像,按钮将显示该文本而不是文本.

Another alternative is to set an image for the button. Create an image that displays the appropriate text and the button will display that instead of text.

我同意 Zack 的观点,下划线文本是多余的,并且违反了界面语法.您首先在链接的文本下划线,以表明它们具有按钮之类的行为.如果文本已经在按钮中,则无需在它下划线以表明它的行为类似于按钮,因为用户已经期望响应单击它的操作.

I agree with Zack that underlining text is redundant and violates the interface grammar. You underline text for links in the first place to indicate that they have behavior like buttons. If the text is already in a button, there is no need to underline it to indicate it behaves like a button because the user already expects an action in response to clicking it.

这篇关于如何在 iOS 上的按钮中显示带下划线的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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