Scroller Help
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Scroller Help
I was hoping someone could explain to me what is going on here... I have a mainstack with 4 cards that each have a ios native scroller on each card. That scroller holds a multitude of buttons that need to be scrolled. My scroller works fine for the most part, but when I visit another card and come back to the previous card, the scroller moves all the buttons down and there is an empty space above the buttons. It is always a empty space the distance that the group was previously scrolled. I could actually get something done on the program if I could get this problem solved. I am attaching my stack and asking that someone PLEASE take a look and take pity on me...I'm frustrated and ready to give up...thanks in advance...
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Scroller Help
Hi Kenny,
Nice looking app.
Add this to all your scrolling cards:
Well depending on what you name your other groups.
Simon
EDIT:
Actually I think setting the vScroll should take place in the preOpenCard but keep the mobileControlDelete in the closeCard.
Nice looking app.
Add this to all your scrolling cards:
Code: Select all
on closeCard
set the vScroll of group "kScroll" to 0
mobileControlDelete sScrollerID
end closeCard
Simon
EDIT:
Actually I think setting the vScroll should take place in the preOpenCard but keep the mobileControlDelete in the closeCard.
Last edited by Simon on Wed Feb 06, 2013 11:56 pm, edited 1 time in total.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Scroller Help
Thank you sooooo much! You have no idea how much this means! Thanks for the compliment btw!
Re: Scroller Help
on another note, I keep noticing that the scroller shifts upwards about the height of 1 button when the group is scrolled causing me to lose the very top button. When I navigate to another card and come back the scroller resets and the button reappears. What could be causing that?
P.S the other problem is now fixed...thanks again for the help...
P.S the other problem is now fixed...thanks again for the help...
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Scroller Help
Hi Kenny,
I've got a workaround but I think this needs to be looked at more carefully.
in your preOpenCard
put the left of group "kGroup", the top of group "KGroup" - 44, ...
Fixes it, but I have not figured out why it needs that so not really advisable.
It's odd and probably a clue that it is exactly 1 button height.
Simon
I've got a workaround but I think this needs to be looked at more carefully.
in your preOpenCard
put the left of group "kGroup", the top of group "KGroup" - 44, ...
Fixes it, but I have not figured out why it needs that so not really advisable.
It's odd and probably a clue that it is exactly 1 button height.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Scroller Help
Hey Simon,
Well, if you noticed in my script, I have been including mobGUI in my design and I have to say that the program causes TONS of headaches...I am trying to phase out mobGUI due to all the bugs that comes with it....I'm a rookie and the program helped at first, but I see now it's just not worth the hassle. Thanks for the work around...I'll give it a shot and see what happens...Initially I tried what you are suggesting, but when I gained the button back at the top of the scroller, I lost the lower button in the scroller....Needless to say, I have been using quite a few four letter words to voice my frustrations.... :0
Well, if you noticed in my script, I have been including mobGUI in my design and I have to say that the program causes TONS of headaches...I am trying to phase out mobGUI due to all the bugs that comes with it....I'm a rookie and the program helped at first, but I see now it's just not worth the hassle. Thanks for the work around...I'll give it a shot and see what happens...Initially I tried what you are suggesting, but when I gained the button back at the top of the scroller, I lost the lower button in the scroller....Needless to say, I have been using quite a few four letter words to voice my frustrations.... :0
-
- VIP Livecode Opensource Backer
- Posts: 7266
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Scroller Help
The trick seems to be to recreate everything from scratch in preOpenCard. Continue to delete the scroller on closeCard.
When you recreate the scroller, the vScroll of the group should be set to 0 before you create the native scroller. That aligns everything. If you want the previous scroll to remain, store it in a variable first. Pseudocode:
Store the current scroll of the group in a variable (if you need it)
Set the vScroll of the group to zero
Create the native scroller
Set the scroll of the native scroller to the saved scroll
Set the scroll of the group to the saved scroll
When you recreate the scroller, the vScroll of the group should be set to 0 before you create the native scroller. That aligns everything. If you want the previous scroll to remain, store it in a variable first. Pseudocode:
Store the current scroll of the group in a variable (if you need it)
Set the vScroll of the group to zero
Create the native scroller
Set the scroll of the native scroller to the saved scroll
Set the scroll of the group to the saved scroll
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Scroller Help
I just sneezed twice.
Don't worry I'm not sick.
I just have a Pseudocold.
Simon
Don't worry I'm not sick.
I just have a Pseudocold.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Scroller Help
Viewed on a small phone 320 x 470
This is not working correctly in that when the first enter the field it will scroll down but sometimes not allow you to see the first part of the text after the scroll. If you leave the card and re-enter the text moves down then allows you to see the top part again.
I have tried adding the code suggested but nothing seems to help with the text chopping after scroll.
Can anyone see what might help keep the text to the top and not chop the first part off after the scroll?
Windows / MAC / IOS / Android - Deployment
Build 5.5.4 / & Community Version 6.1
Build 5.5.4 / & Community Version 6.1
Re: Scroller Help
Issue Solved via Runrev support.
For the benefit of anyone else who has the same issue.
Use this code in the PreOpenCard handler instead of the lesson one.
Adjusting the value that is placed into tContentRect, to both the formattedWidth
and Height of the group "scrollArea" seems to resolve the issue.
For the benefit of anyone else who has the same issue.
Use this code in the PreOpenCard handler instead of the lesson one.
Code: Select all
on preOpenCard
local tScrollerRect, tContentRect
// Only create a scroller on a mobile device
if environment() is not "mobile" then exit preOpenCard
// Set the area of the scroller
put the rect of group "scrollArea" into tScrollerRect
// Set the are of the content to be scrolled
put 0,0,(the formattedWidth of group "scrollArea"),(the formattedHeight of group "scrollArea") into tContentRect
// Create the scroller control
mobileControlCreate "scroller", "loremScroll"
put the result into sScrollerID
// Set the properties of the scroller
mobileControlSet "loremScroll", "rect", tScrollerRect
mobileControlSet "loremScroll", "contentRect", tContentRect
mobileControlSet "loremScroll", "visible", true
mobileControlSet "loremScroll", "scrollingEnabled", true
mobileControlSet "loremScroll", "vIndicator", true
mobileControlSet "loremScroll", "vscroll", 0
end preOpenCard
and Height of the group "scrollArea" seems to resolve the issue.
Windows / MAC / IOS / Android - Deployment
Build 5.5.4 / & Community Version 6.1
Build 5.5.4 / & Community Version 6.1