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?
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?
Suppose your UITextField name is uiTextField. To set font size add the code below
we can't change the cursor height , but we can do some trick , select your textfield and change your textfield border style as
UITextBorderStyleNone
you get the out put as
there after increase the font size of your textfield whatever you want , then you get the output as
I accidentally stumbled across this question and even though it is a little old I feel compelled to answer it since the accepted answer actually isn't correct.
You can indeed change the height (or width) of the cursor. Just subclass the
UITextField
and override this method: