如何使光标的高度与UITextField中的文本的高度相同? [英] How to make the height of the cursor same with the height of text in UITextField?
本文介绍了如何使光标的高度与UITextField中的文本的高度相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的UITextField的光标太长(下图中"123123"的光标)
I have UITextField with too long cursor(the cursor for "123123" in the following image)
如何使光标的高度与文本的高度相同?
How to make the height of the cursor same with the height of text?
推荐答案
我们无法更改光标高度,但是我们可以做一些技巧,选择文本框并将文本框边框样式更改为UITextBorderStyleNone
we can't change the cursor height , but we can do some trick , select your textfield and change your textfield border style as UITextBorderStyleNone
您得到的输出是
根据需要增加文本字段的字体大小,然后输出为
there after increase the font size of your textfield whatever you want , then you get the output as
这篇关于如何使光标的高度与UITextField中的文本的高度相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文