scrollable-touch field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
scrollable-touch field
Hi, is there a way to ,make a table field, scrollable? but not with the scrollbar, but just by scrolling down or up (I'm talking for mobile obviously)
Thanks!
Thanks!
Samuele.
Re: scrollable-touch field
Thanks!
Klaus wrote: ↑Tue Jan 18, 2022 11:33 amhttps://lessons.livecode.com/m/4069/l/9 ... ll-a-field
And more here:
https://lessons.livecode.com/m/4069
Samuele.
Re: scrollable-touch field
Hi I tried this script for a scrollable-touch field on android, it works, but not all the content of the field can be seen, after, you scroll a bit down, it ends the scrolling, before all the content is shown, was I understandable?
Thanks!
Code: Select all
//Scroller
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 "ProvaData",the top of field "ProvaData",the right of field "ProvaData",the formattedHeight of field "ProvaData" into tContentRect
// Create the scroller control
mobileControlCreate "scroller", "RankScroll"
// Set the properties of the scroller
mobileControlSet "RankScroll", "rect", tScrollerRect
mobileControlSet "RankScroll", "contentRect", tContentRect
mobileControlSet "RankScroll", "visible", true
mobileControlSet "RankScroll", "scrollingEnabled", true
mobileControlSet "RankScroll", "vIndicator", true
mobileControlSet "RankScroll", "vscroll", 0
end preOpenCard
on closeCard
// Delete the scroller
if environment() is not "mobile" then exit closeCard
mobileControlDelete "RankScroll"
end closeCard
on scrollerDidScroll hOffset, vOffset
// When the user scrolls move the displayed content
set the vScroll of group "scrollArea" to vOffset
end scrollerDidScroll
Samuele.
Re: scrollable-touch field
Hi Samuele,
you have been hit by an ugly bug: https://quality.livecode.com/show_bug.cgi?id=23177
As a workaround try to add some pixels to the (formatted)height like this:
Try with different values.
Best
Klaus
you have been hit by an ugly bug: https://quality.livecode.com/show_bug.cgi?id=23177
As a workaround try to add some pixels to the (formatted)height like this:
Code: Select all
...
// Set the are of the content to be scrolled
put the left of field "ProvaData",the top of field "ProvaData",the right of field "ProvaData",(the formattedHeight of field "ProvaData" + 20) into tContentRect
...
Best
Klaus
Re: scrollable-touch field
Nooooo!Klaus wrote: ↑Tue Feb 01, 2022 5:01 pmyou have been hit by an ugly bug: https://quality.livecode.com/show_bug.cgi?id=23177
alright thanks, i will try, but since the content of my field changes all the time (becomes more) does it help to add pixels?
Samuele.
Re: scrollable-touch field
No general solution, you will need to experiment a bit...
Re: scrollable-touch field
Klaus wrote: ↑Tue Feb 01, 2022 5:01 pmyou have been hit by an ugly bug: https://quality.livecode.com/show_bug.cgi?id=23177
I noticed this in your bug report: I'm more surprised you bought your first mobile cellphone in April 2021!!!!
Re: scrollable-touch field
Yo, and still have no SIM card!
Re: scrollable-touch field
nooooo, i tried with this change and it remains exactly the same, meaning the field stops at the same point it stopped before the +, do i need to set something to the field or change something else maybe?Klaus wrote: ↑Tue Feb 01, 2022 5:01 pmHi Samuele,
you have been hit by an ugly bug: https://quality.livecode.com/show_bug.cgi?id=23177
As a workaround try to add some pixels to the (formatted)height like this:Try with different values.Code: Select all
... // Set the are of the content to be scrolled put the left of field "ProvaData",the top of field "ProvaData",the right of field "ProvaData",(the formattedHeight of field "ProvaData" + 20) into tContentRect ...
Best
Klaus
Thanks!
Samuele.
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: scrollable-touch field
Samuele,
could you try to set the topLeft of the contentRect to 0,0
like recommended in the first lesson Klaus pointed to
Kind regards
Bernd
could you try to set the topLeft of the contentRect to 0,0
like recommended in the first lesson Klaus pointed to
Code: Select all
put 0,0, the formattedWidth of field "ProvaData", the formattedHeight of field "ProvaData" into tContentRect
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: scrollable-touch field
Also, every time the field content changes you need to delete the old scroller and create a new one. If you don't want to do that you can try just changing the contentRect but I've found it easier to just start again with a fresh scroller. If you don't do that you'll also need to add more code to adjust the content alignment.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com