You know this seems so much easier for situations where you have static text to display! I do this on all my Information screens of my apps.
I use the iphoneControlCreate "multiline" command.
I don't even need to put the name of the control in a local variable and it works like a charm. Just grab an image and set it to the location you would like your scrolling text to show up at, name it "InfoRect" and make it invisible. Have your field "info" contain the text content to scroll and make it invisible too. Then the script is short and sweet.
on opencard
if the environment is "mobile" then
if "testinput" is among the lines of iphoneControls() then
inputDelete
end if
iphoneControlCreate "multiline", "testinput"
iphoneControlSet "testinput", "rect", the rect of image "InfoRect"
iphoneControlSet "testinput", "visible", true
iphoneControlSet "testinput", "fontsize", "15"
iphoneControlSet "testinput", "text", field "info"
iphoneControlSet "testinput","editable","false"
end if
end opencard
on closeCard
if the environment is "mobile" then iphoneControlDelete "testinput"
end closeCard
iOS scrolling text field. How?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: iOS scrolling text field. How?
That is simple. 3 questions though:
1.) What is inputDelete?
2.) Is there a property to eliminate the opaque white background? I need to have this text over my own BG image.
3.) Is there a property to set the lineHeight?
1.) What is inputDelete?
2.) Is there a property to eliminate the opaque white background? I need to have this text over my own BG image.
3.) Is there a property to set the lineHeight?
Re: iOS scrolling text field. How?
Those are good questions. I only have an answer for #1. The inputdelete was a handler where I had:
on inputdelete
iphoneControlDelete "testinput"
end input delete
Kind of a waste of code I know.
This is a good short script for a down and dirty scroller for text info. You can change the font and the scroller sets the scroll of the content on its own even after altering the font size however as far as line size? not sure. as far as background? not sure either.
Dave
on inputdelete
iphoneControlDelete "testinput"
end input delete
Kind of a waste of code I know.
This is a good short script for a down and dirty scroller for text info. You can change the font and the scroller sets the scroll of the content on its own even after altering the font size however as far as line size? not sure. as far as background? not sure either.
Dave
-
- Posts: 379
- Joined: Thu Dec 08, 2011 2:43 am
Re: iOS scrolling text field. How?
A reminder to those working on retina version apps...make sure to cut your rect items in half 

-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
Re: iOS scrolling text field. How?
I have copied the script above from rrBUSS9EE into a button and I want to set the behavior of the scrolling field to it. I set the behavior of the field group using the script below. The behavior gets set to the button but the field doesn't scroll when tested in the sim. Everything works fine if the script executes from the card script. Is there anything in the script that would need to change for it to work in a behavior button or am I doing something wrong?
Thanks,
Tom
Code: Select all
on mouseUp
set the behavior of grp "scrollGroup" of cd "Home" of this stack to the long id of \
button "Scrolling Fld Behavior" of card "WHA Assets" of stack "WHA Assets"
end mouseUp
Tom
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14