"Notes" style native multiline control?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
"Notes" style native multiline control?
I'd like to create an iOS native multiline control with text that scrolls on an image of yellow ruled paper, as is done in the iOS/MacOS Notes app. Setting the background of a native multiline control to an image isn't possible. The obvious solution would be to scroll an image of yellow ruled paper via a scrollerdidscroll handler whenever the multiline scrolls, but as far as I can tell native multiline controls do not send scroll-related messages. I'd really prefer to stick with a native control to take advantage of the auto correction features. Has anyone managed to get something like this working?
Re: "Notes" style native multiline control?
Hello CALL-151,
I've struggled with your problem for a while now.
Sorry to say, but I don't think that it cannot be done as you've described it.
As you know, LiveCode has serious limitations related to its mobile functionality.
When you create a native mobile control, it sits over all of other controls.
I tried to create a scroller and multiline text,
then set the vScroll value of multiline text to the vertical offset of the scroller control.
something like this:
But as I said, native mobile controls doesn't have any layer functionality.
The one that you created last, is the only one which you can interact with.
If you create your controls as:
You can scroll the content of the screen, whatever it is, but you can't interact with the multiline control.
And if you create the controls as:
Then you can edit your text i.e. interact with the multiline control, but nothing related to the scroller control which you've created.
So, it cannot be done as you've described it.
You have to give up to either functionality or appearance.
If you decide to give up functionality; I mean, auto-correction etc. then you can use my attached stack.
It displays a static text but the code can be tweaked to allow editing. Hope it helps...
If you have any questions about my code, I'll be happy to answer.
Best,
~ Ender Nafi Elekçioğlu
I've struggled with your problem for a while now.
Sorry to say, but I don't think that it cannot be done as you've described it.
As you know, LiveCode has serious limitations related to its mobile functionality.
When you create a native mobile control, it sits over all of other controls.
I tried to create a scroller and multiline text,
then set the vScroll value of multiline text to the vertical offset of the scroller control.
something like this:
Code: Select all
on scrollerDidScroll pX, pY
iphoneControlSet "theMultilineText", "vScroll", pY
end scrollerDidScroll
The one that you created last, is the only one which you can interact with.
If you create your controls as:
Code: Select all
on preOpenCard
createTheMultilineControl
createTheScrollerControl
end preOpenCard
And if you create the controls as:
Code: Select all
on preOpenCard
createTheScrollerControl
createTheMultilineControl
end preOpenCard
So, it cannot be done as you've described it.
You have to give up to either functionality or appearance.
If you decide to give up functionality; I mean, auto-correction etc. then you can use my attached stack.
It displays a static text but the code can be tweaked to allow editing. Hope it helps...
If you have any questions about my code, I'll be happy to answer.
Best,
~ Ender Nafi Elekçioğlu
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
Re: "Notes" style native multiline control?
Thanks. Layering wouldn't be an issue if native multiline text objects sent scroller related messages. As I read the latest iOS release notes (p.79), they should but based on a quick test they don't seem to. I've submitted a feature request.
Re: "Notes" style native multiline control? UPDATE
This issue has been acknowledged as a bug by RunRev. Bug report #10555 in the QCC.