Page 1 of 1

Problem..No Scrollbar in window phone Android..

Posted: Thu Jan 31, 2013 12:28 pm
by Fasasoftware
Dear Klaus,
Dear friend,
I have a problem to visualize the scrollbar in a window on phone android..

As klaus says to me.. i have grouped all object of the window then i set in the prospector window i have abilitate the vertical and horizontal scrollbar ...i have set the the card to scrolling property...

i have also put this little script on the card:

Code: Select all

set the vscrollbar of group "example" to true
set the hscrollbar of group "example" to true
when i close my stack and reopen it.... the scrolling bar vertical and horizontal dissappear also before in livecode and then also in android emulator...

but nothing happends...why?? where is my fault??
Thanks a lot,
lestroso :oops:

Re: Problem..No Scrollbar in window phone Android..

Posted: Thu Jan 31, 2013 1:32 pm
by Klaus
Buongiorno Lestroso,

without looking at the stack I can only do some wild guessing:
1. Why don't you directly save the stack with with scrollbars set to TRUE?
Or is it neccessary to do this by script at a certain time?

2. Are you sure that there is something to scroll horizontally?
Is the scrollbar really invisible (FALSE) or do you not see the THUMB of the scrollbar?


Best

Klaus

Re: Problem..No Scrollbar in window phone Android..

Posted: Thu Jan 31, 2013 5:57 pm
by Fasasoftware
Dear klaus,

When i open the stack i go to the prospect inspector....on the group "example"...where i have grouped all objects....i go in the panel to set the Vertical and horizontal scrollbar...the scrollbar appears...then if i save all...and close and reopen the stack... the scrollbar magically dissapears..they are not visible...why??

Where is my fault???what i miss?? can you help me???

Best regards,

Lestroso :oops:

Re: Problem..No Scrollbar in window phone Android..

Posted: Thu Jan 31, 2013 7:12 pm
by Klaus
Hi Lestroso,

sorry, since I do not develop for mobile, I can not check this.
Will move this thread to the ANDROID forum, maybe someone else has an idea.


Best

Klaus

Re: Problem..No Scrollbar in window phone Android..

Posted: Thu Jan 31, 2013 7:47 pm
by jacque
Did you set the lockloc of the group to true? If not, the group will expand to the size of all its contents every time the card redraws. If the group is too large and it has expanded, the edges can be offscreen.

Re: Problem..No Scrollbar in window phone Android..

Posted: Thu Jan 31, 2013 8:07 pm
by Klaus
AHA! Yeah, sounds like this could be it!

See Lestroso, Android experts ARE in fact in the Android forum :D

Re: Problem..No Scrollbar in window phone Android..

Posted: Thu Jan 31, 2013 9:06 pm
by Fasasoftware
Dear Jacqueline,

Your right....BUT...now the scrollbar remain in the app..in livecode...i see always them when i open the stack...but i can't see them..no scrollbar vertical horizantal in the emulator android...!!!..Do i have set something else??? what can i do???

It's very important for me...to work with this scrollbar...because my app result cutted on the screen...

best regards,

Lestroso :oops:

Re: Problem..No Scrollbar in window phone Android..

Posted: Thu Jan 31, 2013 10:12 pm
by Simon
Hi Lestroso,
It's me again.
I remember when you first posted this question and Klaus told you to group the objects.
His advice was correct, except I suggest you start all your posts with:
"I'm developing for Android" because you will get different answers.
Please look up "scroller" in the dictionary and:
http://lessons.runrev.com/s/lessons/m/4 ... ll-a-field
While that lesson talks about a field, the field is grouped so you could have any object in the group.

Simon

Re: Problem..No Scrollbar in window phone Android..

Posted: Thu Jan 31, 2013 10:15 pm
by Klaus
Buonasera Lestroso,

what is happening on a REAL Android device? No scrollbars?

You could create a very small new group in the middle of your card WITH scrollbars set,
so you could test if groups with scrollbars do not work IN GENERAL!
Know what I mean? So we cah see if it is a problem with your special group or a general problem.

Or you could add a litte opencard script like this:

Code: Select all

on opencard

  ## Lock loc:
  set the lockloc of of grp "the one with scrollbars (or not)" to TRUE

  ## Resize group to the screen:
  set the rect of grp "the one with scrollbars (or not)" to the screenrect
  
  ## Now explicitely set the scrollbars:
  set the hscrollbar of of grp "the one with scrollbars (or not)" to TRUE
  set the vscrollbar of of grp "the one with scrollbars (or not)" to TRUE
end opencard
Then see and tell what happens :D


Best

Klaus

P.S.
A screenshot or two might also help.

Re: Problem..No Scrollbar in window phone Android..

Posted: Thu Jan 31, 2013 10:37 pm
by jacque
Yes, a screenshot would be very helpful. Klaus is right, you need to resize the group to fit the device screen every time the app opens, because every Android device has a different screen size. Simon is also correct that you should be using a native scroller. The LiveCode scroller is not efficient on mobile.

Edited to add: LiveCode scrollbars do work on Android, I have a personal app that uses them. They are ugly because they use the ancient Linux Motif appearance but they do appear and they do scroll.

Re: Problem..No Scrollbar in window phone Android..

Posted: Fri Feb 01, 2013 11:54 am
by Fasasoftware
FIRST OF ALL..... I WANT TO THANK YOU EVERYBODY!!!

I want thank you in particular simon.....you have opened my eyes....that livecode lesson that i have never seen... helped me so much...with a little modify i have abilitate also the horizontal and vertical scrolling....

I have tryed to modify that example stack enclose the lesson and bom... i done it...ok...thank you again to everybody...To scroll something in android you must add some piece of code like that....

Code: Select all

local sScrollerID

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 the left of field "lorem",the top of field "lorem",the right of field "lorem",the formattedHeight of field "lorem" 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

on closeCard
   // Delete the scroller
   if environment() is not "mobile" then exit closeCard
   mobileControlDelete sScrollerID
end closeCard

on scrollerDidScroll hOffset, vOffset
   // When the user scrolls move the displayed content
   set the vScroll of group "scrollArea" to vOffset
end scrollerDidScroll

ok thanks again.....

Best regards,

Lestroso :D