UITextField - 删除文本上的省略号 [英] UITextField - Remove Ellipses on Text Overflow

查看:59
本文介绍了UITextField - 删除文本上的省略号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 UItextfield,其中包含一个人的中间名.我只希望它显示第一个首字母,它确实如此,但我希望它保留他们的全名.它的大小仅足以显示一个首字母,但它在字母后添加了省略号 (...).是否可以在 uitextfield 溢出时将其删除?我没有在网上找到任何关于有同样问题的人的信息.

I have a UItextfieldthat holds a person's middle name. I only want it to display the first initial, which it does, but i want it to hold their entire name. It's only large enough to show the one initial, but it adds that ellipses (...) after the letter.Is it possible to remove those when a uitextfield overflows? I haven't found anything online regarding someone with the same issue.

感谢您的帮助

推荐答案

UITextField 不应截断文本(因为您通常可以滚动/选择该 UI 元素).

A UITextField shouldn't be truncating the text (because you can usually scroll/select that UI element).

A UILabel 默认会被截断,您可以将其设置为剪辑.

A UILabel will truncate by default, you can set it to clip instead.

这篇关于UITextField - 删除文本上的省略号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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