QuickDialog: How to create a field for long, multiline text? - ios

I am using QuickDialog to create a form in my iOS app. For one of the items that I am asking users about, I would prefer a multi-line text field as it's an open-ended question (e.g., do you have any questions?). QEntryElement only has a single line, and the space to type is pretty small on an iPhone. Any suggestions for how to do a larger text entry space using QuickDialog?

Instead of QEntryElement, use QMultilineElement. It works exactly the same way - the only problem being that QMultilineElement does not display what the user entered on the main form screen.

Related

Custom iOS keyboard - Custom font output

I am trying to create a custom keyboard using the app keyboard extension. I am happy with the layout but the output is depended on the UITextField's font.
Is there a way to force a different font (use special characters?) while using the keyboard ?
Thank you
It depends.
Text field (or any other view that draws text) uses 2 informations on how to show some text. One is the sequence of characters called String and the other one is how the string should be represented. The second one is then split it things like fonts, colors, line height, line breaking and wrapping...
So the keyboard alone is not enough to for instance present a certain part of word using different fonts. You need at least a bit of access to the item that represents the text. So if you have no access to your text field then the answer is; No, you can not fore a different font when using different keyboard.
If you do have the access then the answer should lie in NSAttributedString. It is a string you can assign to most items under attributedText. This class wraps your raw string and can add many properties to parts of text you want to change. That includes using a different font.
Another approach would be using HTML tags. Again you will need to process this using for instance NSAttributedString or display it with another element like web view.
I would try it with using NSAttributedString. Hook up to delegate and implement textField(: shouldChangeCharactersIn: replacementString:. The implementation itself may still not be easy though.

Create edittext like stackoverflow tag text box

I want to create a multi lined edit text that can hold buttons but also have the ability to add free form text.
It should behave like the tag text box of stackoverflow that is under the body of the question when you ask a question on stackoverflow.
I thought about one layout that holds buttons (e.g. tags) and an edit text right after said layout. But as I want it to be multi-lined and if there was a line break, I'm not sure how the edit text should behave, since it couldn't be a quadratic box anymore.
Can you point me in the right direction? I've seen a post about making parts of an edittext uneditable. I could do this and put buttons over it, but the buttons might be a little bigger than the underlying text.
Do you know of alternatives?
I hope you get the point, if not I'll draw the control.
You can achieve same by using FlowLayout. Keep on adding text/button view it will automatically wraps contents to next line

Creating a signup form using a tableview in xcode (like SnapChat)

I am looking to improve my app's signup and login form from standard text boxes to using table rows (or something similar).
I am pretty much inspired by the forms which SnapChat have created, which you can see below...
I'm trying to figure out how they accomplished this, and am thinking it must be a table view with 3 cells (Static?), and the text below is part of the footer of that selection of cells.
How is one able to then capture data into it directly?
Am I right in maybe assuming that each cell is 'custom' with a text field in each one (with placeholder text) with a no-borders style on the text field?
Or has this been achieved via some other way?
Keen to hear your thoughts. Thanks!
You absolutely could do that with a table view. But I don't think this one is. Notice the divider lines start at the far left rather than at 15 pixels in (with the text). The separator lines are also two pixels tall rather than one. So I'd say it's a safe bet that it's just a simple view with 1 pixel tall UIView's for lines.

Entering/Clearing specific UITextfields?

My aim is to have text boxes - a set amount per level for people to guess a hidden word. I don't want the UITextfield to be tapped and then bring up the keyboard, I'd like to have a different button that brings up the keyboard - if that's possible.
If each box is a separate text field how could I go about entering text. When a user types on the standard apple keypad, how could each character be inputted into a certain text field. I'd preferably like the text to show in the box as soon as a key is tapped.
I'm also having trouble clearing certain letters. Say a user mis-spells something and doesn't realise until the keyboard has resigned as first responder, how could I make it so that a user can tap on maybe two boxes if the rest of the word is spelt right and the program clear it?
Is there any way of writing the program so that it inputs text only if the text field is empty? Continuing with the example above they switch two letters, they tap to clear, they then bring up the keypad and the next key then pressed fills the empty boxes. Not allowing the program to input text in a used text field that only contains a single character?
I'm using Cocos2d - I don't know if that makes a difference. I hope you understand what I mean, although I'm rather bad at explaining.
Thank you in advance for your time and any help :).
Instead of having a textbox that you don't want users to edit, why not use a label?
To show the keyboard, you need to have it linked to some UITextField (or similar). You could use an invisible UITextField, and then monitor the input and send the characters to the correspinding labels. Refer to this question.
To check if a textfield has anything in it:
[textField.text length] > 0, but I would use labels instead of textfields.
I dont really understand the other parts of your question.

Dynamically change certain text in textarea with drop-down selection

I have a text area that has names within the default value. For example the textarea reads..
(dynamic registrant name) just registered to become
a donor in (dynamic from pull-down above)
honor. This text is editable
So in the same form I have an input that asks the user for their name and a select box where they can choose among a selections of names. I am trying to change the names within the text area based on the values they enter in the input and drop-down fields above the text area. Can someone help with this? I am completely stuck. I have read through some of the forums here and it looks like a lot of the solutions are to use ajax. I have zero experience in ajax and would like to find a solution that does not use that...is it possible? Or could someone help with a solution?
I don't think textarea is what you want exactly. What if the user takes off the (dynamic from pull-down above) part? How would you know where to put the text at? Even if you somehow could, I suggest you make regular text input elements for contents that the user can change and put the other dynamically changing text as uneditable html text elements (or however you want to format them).

Resources