Startseite › Foren › Deutsches LiveCode-Forum › Cards › Antwort auf: Cards
Hi Klaus,
so wollte ich es nun auch machen. Hat auch super geklappt! Danke für den Tip mit „in window of this stack“ das erleichtert die Sache deutlich.
Die Fragen und Antworten mache ich dann wie Hauke in seinem Buch erklärt bzw hier.
Noch zwei eine Fragen 😉
Wie erstelle ich denn ein ScrollArea. Den Code und die Group habe ich aus einem Beispiel. Aber das eigentliche Feld bzw die Group verstehe ich nicht wie man das „händisch“ erstellt.
Ist das in iOS und Android gleich? Es gibt doch iOSScroll und AndroidScroll.
Puh wieder ganz schön viele Fragen 🙂
Code:
local sScrollerID
on preOpenCard
local tScrollerRect, tContentRect
if environment() is not „mobile“ then exit preOpenCard
put the rect of group „scrollArea“ into tScrollerRect
put 0,0,the formattedWidth of fld „Entry“, the formattedHeight of fld „Entry“ into tContentRect
mobileControlCreate „scroller“, „loremScroll“
put the result into sScrollerID
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
if environment() is not „mobile“ then exit closeCard
mobileControlDelete sScrollerID
end closeCard
on scrollerDidScroll hOffset, vOffset
set the vScroll of group „scrollArea“ to vOffset
end scrollerDidScroll