Scroll through a card in Landscape view
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Scroll through a card in Landscape view
Having added some really cool buttons thanks to Klaus' direction last night I now want to give the use the option to but the iPhone into landscape mode to make the text etc a little bigger. I have figured out how to do that but clearly that means that not all the card is showing.
I have read lots about scroll bars - but is that really necessary ? Should not the user be able to simply touch the screen and scroll down the card ?
I read http://lessons.runrev.com/s/lessons/m/4 ... chitecture
but this talks about scrolling groups, i did try to implement it without success for what I wanted.
SO the simple question is - is what Im trying to do possible and is it the above lesson that I should be following or is that different ?
Thanks
Dazza
I have read lots about scroll bars - but is that really necessary ? Should not the user be able to simply touch the screen and scroll down the card ?
I read http://lessons.runrev.com/s/lessons/m/4 ... chitecture
but this talks about scrolling groups, i did try to implement it without success for what I wanted.
SO the simple question is - is what Im trying to do possible and is it the above lesson that I should be following or is that different ?
Thanks
Dazza
Re: Scroll through a card in Landscape view
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Re: Scroll through a card in Landscape view
Thanks Simon
That is clearly worked on a very simple single field card in that link.
Clearly I appreciate that it will work on a more complicated card, on the card in question I have text boxes, buttons and input fields.
My idea was that maybe i need to group all these items together and then refer to that group name on the line
put 0,0,(the formattedWidth of group "scrollArea"),(the formattedHeight of group "scrollArea") into tContentRect -
with "scrollArea" being the group name - that was my idea but can t get it to work ...am i along the right lines ?
Dazza
That is clearly worked on a very simple single field card in that link.
Clearly I appreciate that it will work on a more complicated card, on the card in question I have text boxes, buttons and input fields.
My idea was that maybe i need to group all these items together and then refer to that group name on the line
put 0,0,(the formattedWidth of group "scrollArea"),(the formattedHeight of group "scrollArea") into tContentRect -
with "scrollArea" being the group name - that was my idea but can t get it to work ...am i along the right lines ?
Dazza
Re: Scroll through a card in Landscape view
Hi Dazza,
That sounds good but need more info on what is not working?
Does using the stock Scroller_Example.zip work?
Remember to lock the size and position of group "scrollArea".
Simon
That sounds good but need more info on what is not working?
Does using the stock Scroller_Example.zip work?
Remember to lock the size and position of group "scrollArea".
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Re: Scroll through a card in Landscape view
Thanks Simon
Yes I have locked the area. I have effectively put all of the contents on that card into a group called "Scrollarea" and I was hoping that when i swapped to landscape mode it would then allow me to scroll up and down but it doesn't. I just see part of the screen.
The only bit i changed was this
// Set the area of the scroller
put the rect of group "scrollArea" into tScrollerRect
// Set the are of the content to be scrolled
put the left of field "lorem",the top of field "lorem",the right of field "lorem",the formattedHeight of field "lorem" into tContentRect
to
put 0,0,(the formattedWidth of group "scrollArea"),(the formattedHeight of group "scrollArea") into tContentRect
Which I thought was the right thing to do ?
The zip file does work ok
Yes I have locked the area. I have effectively put all of the contents on that card into a group called "Scrollarea" and I was hoping that when i swapped to landscape mode it would then allow me to scroll up and down but it doesn't. I just see part of the screen.
The only bit i changed was this
// Set the area of the scroller
put the rect of group "scrollArea" into tScrollerRect
// Set the are of the content to be scrolled
put the left of field "lorem",the top of field "lorem",the right of field "lorem",the formattedHeight of field "lorem" into tContentRect
to
put 0,0,(the formattedWidth of group "scrollArea"),(the formattedHeight of group "scrollArea") into tContentRect
Which I thought was the right thing to do ?
The zip file does work ok
Re: Scroll through a card in Landscape view
Hi Dazza,
It sounds like you have a resizing issue.
That will make the rect of the scrollArea fit the whole screen, you can do other stuff.
You have to go through all the "put the rect of group "scrollArea" into tScrollerRect" and contentRect again.
How's that?
Simon
It sounds like you have a resizing issue.
Code: Select all
on orientationChanged
put the effective working screenRect into tSize
set the rect of group "scrollArea" to tSize
end orientationChanged
You have to go through all the "put the rect of group "scrollArea" into tScrollerRect" and contentRect again.
How's that?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Re: Scroll through a card in Landscape view
OK thanks Simon - Im not sure I completely understand that but I will have a play - I have to say not being able to search at the moment on most of the live code sites is proving difficult for a newbie.
On a side issue whilst trying the implement your suggestions, all of a sudden the IOS simulator only now shows the top left hand quarter of my cards. Have I hit a button somewhere that I shouldn't of. So my Stack in Livecode works fine in play or edit mode but as soon as i put it in the simulator just the top left quartile ?
Dazza
On a side issue whilst trying the implement your suggestions, all of a sudden the IOS simulator only now shows the top left hand quarter of my cards. Have I hit a button somewhere that I shouldn't of. So my Stack in Livecode works fine in play or edit mode but as soon as i put it in the simulator just the top left quartile ?
Dazza
Re: Scroll through a card in Landscape view
Hi Dazza,
All the script above does is to resize the group so it fits the whole screen on portrait and landscape. This is just for your testing, for a full app you might do things differently.
You do have "mobileAllowedOrientations" set right?
For the quarter screen issue I'd go for a reboot. I never trust the sims but xCodes iOS is better than Android AVD. But yes, the code above does resize the group so it could be manipulated to size the group to only a quarter of the screen (not what I wrote).
Simon
All the script above does is to resize the group so it fits the whole screen on portrait and landscape. This is just for your testing, for a full app you might do things differently.
You do have "mobileAllowedOrientations" set right?
For the quarter screen issue I'd go for a reboot. I never trust the sims but xCodes iOS is better than Android AVD. But yes, the code above does resize the group so it could be manipulated to size the group to only a quarter of the screen (not what I wrote).
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Re: Scroll through a card in Landscape view
Thanks Simon
I have rebooted but it didn't make any difference. Strangely when i deploy the app to the actual iPhone its fine but still not in the simulator.
I have found comment online about the simulator using a retina size display and therefore requiring 4 times the space and hence why only 1/4 shows but I have my stack size is at 1136x640 and the simulator is set at iPhone 4 Retina 4" So I think that is all correct. My phone is an 5C.
Any anyway its been working fine for the last 2 weeks since i started on Livecode. Just to make sure I took out all of the additional code I had added to ensure it wasn't that. - very odd
This is what I have on my stack script - I believe that is correct ?
on preopenstack
mobileSetAllowedOrientations "portrait,portrait upside down,landscape left,landscape right"
mobileSetKeyboardType "decimal"
end preopenstack
I seem to take one step forward and 3 back some days but I have to keep reminding myself of what I have learnt in the two weeks !
Thanks for everyones help, once i get this sorted I will go back to the scrolling!
I have rebooted but it didn't make any difference. Strangely when i deploy the app to the actual iPhone its fine but still not in the simulator.
I have found comment online about the simulator using a retina size display and therefore requiring 4 times the space and hence why only 1/4 shows but I have my stack size is at 1136x640 and the simulator is set at iPhone 4 Retina 4" So I think that is all correct. My phone is an 5C.
Any anyway its been working fine for the last 2 weeks since i started on Livecode. Just to make sure I took out all of the additional code I had added to ensure it wasn't that. - very odd
This is what I have on my stack script - I believe that is correct ?
on preopenstack
mobileSetAllowedOrientations "portrait,portrait upside down,landscape left,landscape right"
mobileSetKeyboardType "decimal"
end preopenstack
I seem to take one step forward and 3 back some days but I have to keep reminding myself of what I have learnt in the two weeks !
Thanks for everyones help, once i get this sorted I will go back to the scrolling!
-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Re: Scroll through a card in Landscape view
Just incase it give anyone any clues - if i start the iOS simulator up without my app then its hows a full screen as expected, also using the test Scrolling file from the live code website also seems to work ok. So it must be a setting in my app. however having stripped it down, the only script i have is
on main stack
on preopenstack
mobileSetKeyboardType "decimal"
mobileSetAllowedOrientations "portrait,portrait upside down,landscape left,landscape right"
end preopenstack
on keydown k
if k is in "0123456789." then pass keydown
end keydown
and then on the first card there is no script, its just a simple button menu
on main stack
on preopenstack
mobileSetKeyboardType "decimal"
mobileSetAllowedOrientations "portrait,portrait upside down,landscape left,landscape right"
end preopenstack
on keydown k
if k is in "0123456789." then pass keydown
end keydown
and then on the first card there is no script, its just a simple button menu

Re: Scroll through a card in Landscape view
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Re: Scroll through a card in Landscape view
Thanks Simon - yes that link sorted my simulator problem, back to normal now thank you, I can now go back to figuring out the scrolling challenge
Regards
Dazza
Regards
Dazza
-
- Posts: 44
- Joined: Sat May 17, 2014 1:48 pm
Re: Scroll through a card in Landscape view
Im beat for now - I think i will give it a few days and see if the issue which googling on rev and live code sites gets sorted. As a search result keeps springing up that relates to my issue but then won't open, very frustrating. I have tried clearing cache and cookies but that isn't helping.
Thanks for eveyones help so far, I have looked at those lessons Simon and for one reason or another despite using the same principles they teach it doesn't want to work. Sometimes a break for a few days is a good thing.....I might remind myself what my children look like lol !
Dazza
Thanks for eveyones help so far, I have looked at those lessons Simon and for one reason or another despite using the same principles they teach it doesn't want to work. Sometimes a break for a few days is a good thing.....I might remind myself what my children look like lol !
Dazza