i work with ios 8 swift an have a textfield into a table cell.
if i put in this textfield a short text, i have no problems.
but is there a long text, the end of the this will cut, like this:
"This is the Exmaple of ..."
how can i set dynamic a second line in to my textfield, if the text will be to long for it?
i do not have any code because i dont know how i can solve this situation.
UITextField can contains only one line of text. The component you need is the UITextView.
Related
Here consider this image. I have taken a toolbar with icons for text formatting. After selecting that sentence if I hit B (bold) it should be bold. Even I need that too if I select bold then further text to be show as bold. Consider this textbox UITextField. Incase you have some good reference like github you are welcome. I have already spend two days in a row in SO but not get any proper solution. One bold function is enough for me.
I have set the values of placeholder
self.baseURLTextField.placeholder = ServiceUrl_English;
self.paymentBaseURLTextField.placeholder = PAYMENTSERVICEURL_ENGLISH;
I just want to move the placeholder up while editing or typing in textfield. is it possible through just only storyboard? or code in Objective-C.
Not really the way you intended it. Placeholder is just a hint of what should be typed in the textField and it's supposed to be removed once text entry starts.
If you want the placeholder to "move up" I suggest you either prefill the textField with the text you want to preserve, or simply add the text at the point user starts typing in, and move the cursor to where you want the user text to start.
You can achieve this by putting a UILabel at the top of the text view then show/hide it whenever the user starts typing.
Or you can use a pod like JVFloatLabeledTextField
Details of the issue :
When display text inside UILabel and almost the text fill complete line, if you add one more character with spacial character such as "ً" (check number 1) , it cuts first letter of text and put it in line alone(check number 2) and the rest of text in other line (check number 3)
Please note that the issue happening in the Facebook app and iOS note app
Try setting the linebreak mode to word wrap.
This may help.
Another option, try using textview instead of label.
I have around 25 words, which I need to copy into clipboard (25 different for each category). At first I've made a textView, but it is not possible to copy it into clipboard. So I used a textField, but it doesnt look good, because it has only one line and it doesnt show all of the words.
Is there any way I can make textField multiline or any way to copy content of textView?
Thank you for your reply.
I have a uiTextField with dynamic text.
How can I set it via the editor to split the text into 2 lines (or more)
if text doesn't fit in the uiTextField width?
Is there a way to do this not programmatically?
Now text is seen as
"This is a long line" ===>
"This is...."
and I want it to be
"This is a
long line"
UITextField is one line only. You can not have multi line content in UITextField. If you want to have multi line then use UITextView.
As Vishnu said you need to use UITextview for multiple row textfield
also add a "\n" where you want to break the string into the next line like so
"This is a\nlong line"