1
我一直在試圖找出了好幾天!如何獲得平滑滾動觸摸設備上的所有其他應用程序有..暫且我實現了這一點:AS3:光滑的觸摸滑動滾動的iOS
Multitouch.inputMode = MultitouchInputMode.GESTURE;
stage.addEventListener (TransformGestureEvent.GESTURE_SWIPE, fl_SwipeHandler);
function fl_SwipeHandler(event:TransformGestureEvent):void
{
switch(event.offsetX)
{
// swiped right
case 1:
{
// Start your custom code
// This example code moves the selected object 20 pixels to the right.
// End your custom code
break;
}
// swiped left
case -1:
{
// Start your custom code
// This example code moves the selected object 20 pixels to the left.
// End your custom code
break;
}
}
switch(event.offsetY)
{
// swiped down
case 1:
{
// Start your custom code
// This example code moves the selected object 20 pixels down.
if (PActive == true) {
dgPlace.verticalScrollPosition = dgPlace.verticalScrollPosition - 60;
}
if (SActive == true) {
dgSubject.verticalScrollPosition = dgSubject.verticalScrollPosition - 60;
}
if (OActive == true) {
dgObject.verticalScrollPosition = dgObject.verticalScrollPosition - 60;
}
if (FActive == true) {
dgFeeling.verticalScrollPosition = dgFeeling.verticalScrollPosition - 60;
}
if (AActive == true) {
dgAction.verticalScrollPosition = dgAction.verticalScrollPosition - 60;
}
if (NActive == true) {
dg.verticalScrollPosition = dg.verticalScrollPosition - 60;
}
// End your custom code
break;
}
// swiped up
case -1:
{
// Start your custom code
// This example code moves the selected object 20 pixels up.
if (PActive == true) {
dgPlace.verticalScrollPosition = dgPlace.verticalScrollPosition + 60;
}
if (SActive == true) {
dgSubject.verticalScrollPosition = dgSubject.verticalScrollPosition + 60;
}
if (OActive == true) {
dgObject.verticalScrollPosition = dgObject.verticalScrollPosition + 60;
}
if (FActive == true) {
dgFeeling.verticalScrollPosition = dgFeeling.verticalScrollPosition + 60;
}
if (AActive == true) {
dgAction.verticalScrollPosition = dgAction.verticalScrollPosition + 60;
}
if (NActive == true) {
dg.verticalScrollPosition = dg.verticalScrollPosition + 60;
}
// End your custom code
break;
}
}
這基本上只是說如果發生滑動,然後向上或向下滾動60個單位,這是2行的活動數據網格。請任何人有任何想法如何做到這一點,我將不勝感激的幫助。^_^
我不知道我理解你的問題。首先,刷卡不滾動!爲什麼你想爲數據網格實現自己的滾動實現?網格帶有它自己的滾動容器。如果你想爲你的網格使用某種類型的滑動(無論出於何種原因),我強烈推薦使用Gestouch庫。 – AlBirdie
刷卡滾動本身不上航的iOS應用程序在DataGrid中的建議工作..謝謝,我會試試看。 – 4t0m1c