Scroller And Keyboard
Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21
Scroller And Keyboard
OK, I'm THIS close to having one of my prototypes ready to go BUT, I have a problem.
I have several text fields on a card, toward the bottom. When the keyboard pops up, those fields are covered.
I'm assuming I would use a scroller....somehow....to address this but
a) What all would I put in the scroller? Do I include the NavBar and all the labels and fields and buttons? What about the background?
b) Do I just Edit Group on the scroller and start dragging interface elements from MG into the group?
c) When the keyboard pops up I want to catch keyboardActivated in the card, right? Is that the way to handle this situation?
d) What properties of the scroller can I set? I would think I would first have to move the entire group and then set the vertical scroll to something, but since this is a MG control and I don't see the appropriate custom properties anywhere, I'm not sure what I am supposed to touch and what I am supposed to leave alone.
I have several text fields on a card, toward the bottom. When the keyboard pops up, those fields are covered.
I'm assuming I would use a scroller....somehow....to address this but
a) What all would I put in the scroller? Do I include the NavBar and all the labels and fields and buttons? What about the background?
b) Do I just Edit Group on the scroller and start dragging interface elements from MG into the group?
c) When the keyboard pops up I want to catch keyboardActivated in the card, right? Is that the way to handle this situation?
d) What properties of the scroller can I set? I would think I would first have to move the entire group and then set the vertical scroll to something, but since this is a MG control and I don't see the appropriate custom properties anywhere, I'm not sure what I am supposed to touch and what I am supposed to leave alone.
Re: Scroller And Keyboard
Hi Mikey,
You may or may not have to use a scroller, but the first solution to this problem is to create another card with a field in the top part of the card. Go to this card whenever you need the user to enter text. This way, your field is always in the right place. Once the user finishes entering text, go back to the previous card and put the text where you need it. Of course, you can add a scroller to this field if the user needs to enter multiple lines. Make sure that you adjust the properties of the scroller as the formattedHeight of the field changes. Read the release note for iOS included with LiveCode.
In a few cases, I changed the location of objects dynamically, but it is probably easier and more beautiful to have a specially designed card for this.
Best,
Mark
You may or may not have to use a scroller, but the first solution to this problem is to create another card with a field in the top part of the card. Go to this card whenever you need the user to enter text. This way, your field is always in the right place. Once the user finishes entering text, go back to the previous card and put the text where you need it. Of course, you can add a scroller to this field if the user needs to enter multiple lines. Make sure that you adjust the properties of the scroller as the formattedHeight of the field changes. Read the release note for iOS included with LiveCode.
In a few cases, I changed the location of objects dynamically, but it is probably easier and more beautiful to have a specially designed card for this.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Scroller And Keyboard
Unfortunately, there are 7 fields on the card, so having a card for each is not an option, but thanks for the suggestion.
Re: Scroller And Keyboard
Hi Mikey,
Yes, it IS an option. You won't have one card for each field. You will have one card for all fields. When you open the card, you will be editing only one field. When you press the Next or Go button on the keyboard, a script will put the text into the right field and you change currently edited field to #2 etc. It is not as difficult as you might think. You might also want to show a label above the editable field, to indicate which field is currently being edited.
Kind regards,
Mark
Yes, it IS an option. You won't have one card for each field. You will have one card for all fields. When you open the card, you will be editing only one field. When you press the Next or Go button on the keyboard, a script will put the text into the right field and you change currently edited field to #2 etc. It is not as difficult as you might think. You might also want to show a label above the editable field, to indicate which field is currently being edited.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Scroller And Keyboard
Mark,
I appreciate the idea, and I understand how to implement it. However, the user needs to be able to see the other fields while typing into the one they are in. This is similar to the way the calendar works when you are entering an event - the scroll is on the current field, but the user is able to scroll up while the field still has the focus to see the other values.
I appreciate the idea, and I understand how to implement it. However, the user needs to be able to see the other fields while typing into the one they are in. This is similar to the way the calendar works when you are entering an event - the scroll is on the current field, but the user is able to scroll up while the field still has the focus to see the other values.
Re: Scroller And Keyboard
Hi Mikey,
You could group the fields and make the group scroll with a UIScrollView. That's how the calendar does it.
Best,
Mark
You could group the fields and make the group scroll with a UIScrollView. That's how the calendar does it.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Scroller And Keyboard
There is still the matter of dealing with the keyboard. So back to my original question,
a) What all would I put in the scroller? Do I include the NavBar and all the labels and fields and buttons? What about the background?
b) Do I just Edit Group on the scroller and start dragging interface elements from MG into the group?
c) When the keyboard pops up I want to catch keyboardActivated in the card, right? Is that the way to handle this situation?
d) What properties of the scroller can I set? I would think I would first have to move the entire group and then set the vertical scroll to something, but since this is a MG control and I don't see the appropriate custom properties anywhere, I'm not sure what I am supposed to touch and what I am supposed to leave alone.
a) What all would I put in the scroller? Do I include the NavBar and all the labels and fields and buttons? What about the background?
b) Do I just Edit Group on the scroller and start dragging interface elements from MG into the group?
c) When the keyboard pops up I want to catch keyboardActivated in the card, right? Is that the way to handle this situation?
d) What properties of the scroller can I set? I would think I would first have to move the entire group and then set the vertical scroll to something, but since this is a MG control and I don't see the appropriate custom properties anywhere, I'm not sure what I am supposed to touch and what I am supposed to leave alone.