2

我正在开发适用于 Android、iPhone、Windows 的 livecode 应用程序。我想将滚动条添加到组中。因此,我将组的垂直滚动条设置为true,它与右侧的垂直滚动条很好地配合 Windows。但是在为 Android 测试它时,仍然有一个垂直条用于滚动,我假设它可能会像 android 附带的基本滚动器一样自动工作。

我想为 Android 和 Iphone 添加一个触摸滚动条而不是垂直滚动条。我怎么能这样做?

4

2 回答 2

4

本课说明如何为文本字段创建本机滚动条。但是,此方法可以在任何组上实施-

http://lessons.runrev.com/s/lessons/m/4069/l/94412-creating-a-native-scroller-to-scroll-a-field

于 2013-07-22T08:27:23.387 回答
1

我向原作者道歉,由​​于缺乏署名,这里有一些脚本允许在桌面和移动平台上滚动组,并且不使用本机 iOS 或 Android 滚动“覆盖”:

local allowMove

on mouseDown
   put mouseH(),mouseV() into allowMove
end mouseDown

on mouseMove X,Y
   if allowMove is not empty then
      lock screen
      if the hScrollbar of me then
         set the hScroll of me to the hScroll of me + (item 1 of allowMove-X)
      end if
      if the vScrollbar of me then
         set the vScroll of me to the vScroll of me + (item 2 of allowMove-Y)
      end if
      put X into item 1 of allowMove
      put Y into item 2 of allowMove
      unlock screen
   end if
end mouseMove

on mouseUp
  put empty into allowMove
end mouseUp

on mouseRelease
  mouseUp
end mouseRelease

我对原始脚本进行了轻微修改,以便仅在相应的滚动条可见时才允许滚动。这使得启用或禁用不同方向的滚动变得非常快速和容易。我用它来做原型。

于 2013-08-13T16:50:13.153 回答