我必须具有左右滑动的手势能力,但我还需要显示列表视图,但一旦显示,我就会看到左右滑动的能力。你将如何处理这个问题?
这是我程序中的一小段代码。
CustomGestureArea{
onSwipeRight:{
// do something
}
onSwipeLeft:{
// do something
}
// as soon as i put this in i loose the swipe functionality
ListView{
anchors.fill:parent
}
}
我正在考虑制作另一个自定义手势类,该类将包含一个列表视图,我将为模型设置属性别名,并为列表视图设置其他所需信息,使其正常工作,但在上下滑动时,它将滚动列表(正如正常列表视图功能所预期的那样)。但我甚至不知道如何开始。我的想法是列出这个。
GestureAreaListView{
property alias list_model:list.model
// and all other needed properties etc
onSwipeRight:{
// do my custom function
}
onSwipeLeft:{
// do my custom function
}
onSwipeUp:{
// do List view scroll up
}
onSwipeDown:{
// do List view scroll down
}
// as soon as i put this in i loose the swipe functionality
ListView{
anchors.fill:parent
}
ListView{
id: list
}
}