Windows phone 8 如何在windows phone 8应用程序中设置横向滑动控制
我正在尝试为横向方向设置滑动控制,我正在使用下面的代码为potrait方向设置滑动控制。请帮助在横向方向中进行此操作 接触点优先Windows phone 8 如何在windows phone 8应用程序中设置横向滑动控制,windows-phone-8,Windows Phone 8,我正在尝试为横向方向设置滑动控制,我正在使用下面的代码为potrait方向设置滑动控制。请帮助在横向方向中进行此操作 接触点优先 private List<TList> _pivotList; public Pivot() { InitializeComponent(); Loaded += pivot_Loaded; Touch.FrameReported += Touch_FrameReported;
private List<TList> _pivotList;
public Pivot()
{
InitializeComponent();
Loaded += pivot_Loaded;
Touch.FrameReported += Touch_FrameReported;
}
私有void Touch_FrameReportedobject发送方,TouchFrameEventArgs e
{
TouchPoint mainTouch=e.GetPrimaryTouchPointnull
if (mainTouch.Action == TouchAction.Down)
_first = mainTouch;
else if (mainTouch.Action == TouchAction.Up)
{
var xDelta = mainTouch.Position.X - _first.Position.X;
var yDelta = Math.Abs(mainTouch.Position.Y - _first.Position.Y);
if (yDelta > Math.Abs(xDelta))
return;
if (Math.Abs(xDelta - 0) > 10)
{
var currentIndex = pivotList.SelectedIndex;
int noOfPivotItems = pivotList.Items.Count;
currentIndex = (xDelta < 0) ?
++currentIndex % noOfPivotItems :
(--currentIndex + noOfPivotItems) % noOfPivotItems;
pivotList.SelectedIndex = currentIndex;
}
}
}请向我们展示您已经发现的内容。乍一看,你的内存好像用完了。你为什么要把整整100页都保存在内存中?请尝试仅将前5页和后5页保留在内存中。任何示例都可以,因为我是此windows phone开发人员。我附近没有开发环境,但在滑动数据透视表时,请尝试交换页面。比如说,每次你刷卡的时候,我想这将是一个事件,你会保持5个先前的currentIndex-5和5个后续的currentIndex+5项被加载。