In a view of my application for iOS, a user is asked to fill out all underline blanks in not fixed number of distinct questions of the following form(for example):
My ID is _ _ _ _ and telephone number is _ _ _ - _ _ _ _.
Since questions are not fixed, UIText is not enough to use for my requirement. I spent three days on finding proper UI control and view but did not find it.
Is there any UI control and view for my requirement? If not, I need to build some my own UI control and view using UIKit. Could you recommend any good reference for building customized UI using UIKit? Any suggestion would be very welcomed. Thank you.
Have you considered using a UITableView in which you can have the question in the Cell and then a UITextField as the accessory view? You probably already know before that view is called how many questions should be shown on that screen so then you can just use a loop to create a cell within the table view for each question you need to show the user.
In a view of my application for iOS, a user is asked to fill out all underline blanks in not fixed number of distinct questions of the following form(for example):
My ID is _ _ _ _ and telephone number is _ _ _ - _ _ _ _.
Since questions are not fixed, UIText is not enough to use for my requirement. I spent three days on finding proper UI control and view but did not find it.
Is there any UI control and view for my requirement? If not, I need to build some my own UI control and view using UIKit. Could you recommend any good reference for building customized UI using UIKit? Any suggestion would be very welcomed. Thank you.
So you need to create a custom sentence with user-entered blanks at arbitrary points? The underlines in your example show a sample data entry field, but there might be others, like
My name is _______ ________, and I am __ years old.
Is that right?
You could build a collection of views through code. Create UILabels for the static text and UITextField objects for the input data.
You could use the text for the labels to calculate how wide they need to be, and use maximum input size to size the text fields.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
So you need to create a custom sentence with user-entered blanks at arbitrary points? The underlines in your example show a sample data entry field, but there might be others, like
My name is _______ ________, and I am __ years old.
Is that right?
You could build a collection of views through code. Create UILabels for the static text and UITextField objects for the input data.
You could use the text for the labels to calculate how wide they need to be, and use maximum input size to size the text fields.
Thank you very much Duncan for your suggestion. For one more question about your idea, suppose I know the number of letters(or characters) which is same as that of small underlined blanks in each question, say 50 letters. Then, if I want to use 50 UITextField objects for each question, do you think it is quite heavy or a waste of computational resources for iphone?