xamarin.forms页面导航速度太慢
我的页面具有以下层次结构xamarin.forms页面导航速度太慢,xamarin.forms,Xamarin.forms,我的页面具有以下层次结构 <Grid> <AbsoluteLayout Grid.Row = 0> // Contains header </AbsoluteLayout> <AbsoluteLayout Grid.Row = 1> <Scrollview> <Grid> <AbsoluteLayout Grid.Row = 0>
<Grid>
<AbsoluteLayout Grid.Row = 0>
// Contains header
</AbsoluteLayout>
<AbsoluteLayout Grid.Row = 1>
<Scrollview>
<Grid>
<AbsoluteLayout Grid.Row = 0>
// Contains Image
</AbsoluteLayout>
<Grid>
<ListView Grid.Row = 0>
// I know its not good thing to use listview inside scrollview but I have to use it.
</ListView>
<Button Grid.Row = 1 Text = "Add Item1"/>
</Grid>
<Grid>
<ListView Grid.Row = 0>
</ListView>
<Button Grid.Row = 1 Text = "Add Item2"/>
</Grid>
</Grid>
</Scrollview>
</AbsoluteLayout>
<AbsoluteLayout Grid.Row = 2>
// Contains Footer
</AbsoluteLayout>
</Grid>
//包含标题
//包含图像
//我知道在scrollview中使用listview不是件好事,但我必须使用它。
//包含页脚
现在,当我点击按钮导航到这个页面时,加载大约需要3-4秒,这是我想得太多了
我在页脚中只使用了2个StackLayout
,因为我读到StackLayout
会减慢应用程序的速度
有没有其他方法可以加快我的导航速度
编辑-从构造函数跳到OnAppearing()需要1秒。在onAppeaing()中,我填写代码中显示的列表
非常感谢。您是在特定平台(如iOS、Android)上看到这个问题,还是在所有平台上都看到了这个问题?另外,您使用的是哪个版本的Xamarin.Forms?这是发布还是调试问题?您的输出窗口是否表示在主线程上做了太多工作?你在页面构造函数中做了什么吗?@E.Z.Hart我还没有在iOS设备上检查过。我正在使用android设备。我正在使用最新版本的xamarin。forms@Rohit这是调试问题。我在构造函数中调用两个方法进行数据绑定。我的输出窗口显示“跳过124帧!”!应用程序可能在主线程上做了太多的工作。“你能提供这个设计背后的C代码吗?”?