Listview 表单列表视图和kitkat电话仿真器
我使用VS 2015做了一个简单的跨平台应用程序,其中包含一个Xamarin.Forms listview,listview数据通过对远程API web服务的C#调用绑定到结果。web api服务的调用只返回大约50个数据行,当用户在模拟器上向下滚动listview时,这些数据行将逐渐显示。我还为Android使用VS模拟器。该应用程序与10.1的“棉花糖60.0 XHDPI平板API级别23仿真器”工作良好,但是它在4.5个“KITKAT 4.4 HDPI电话API级19仿真器”的滚动下移过程中死亡并关闭它本身。p> 我不知道listview如何与手机模拟器配合使用。我是一个使用Xamarin.Forms UI小部件的新手。我想这次崩溃可能与4.5英寸Kitkat手机模拟器的内存问题有关,但我不确定 我通过使用Android设备登录VS捕获了一些崩溃日志,如下所示:Listview 表单列表视图和kitkat电话仿真器,listview,android-emulator,xamarin.forms,Listview,Android Emulator,Xamarin.forms,我使用VS 2015做了一个简单的跨平台应用程序,其中包含一个Xamarin.Forms listview,listview数据通过对远程API web服务的C#调用绑定到结果。web api服务的调用只返回大约50个数据行,当用户在模拟器上向下滚动listview时,这些数据行将逐渐显示。我还为Android使用VS模拟器。该应用程序与10.1的“棉花糖60.0 XHDPI平板API级别23仿真器”工作良好,但是它在4.5个“KITKAT 4.4 HDPI电话API级19仿真器”的滚动下移过程
04-28 07:47:08.295 D/Mono ( 1239): [0xb92a8220] hill climbing, change max number of threads 3
04-28 07:47:08.447 D/dalvikvm( 1239): GC_FOR_ALLOC freed 1124K, 19% free 5397K/6588K, paused 1ms, total 2ms
04-28 07:47:08.683 D/Mono ( 1239): [0xb955cad0] hill climbing, change max number of threads 2
04-28 07:47:08.883 D/dalvikvm( 1239): GC_CONCURRENT freed 307K, 11% free 5924K/6588K, paused 0ms+0ms, total 1ms
04-28 07:47:09.999 D/Mono ( 1239): [0xb92b3b00] hill climbing, change max number of threads 3
04-28 07:47:10.699 D/Mono ( 1239): [0xb92a8220] hill climbing, change max number of threads 2
04-28 07:47:10.815 D/DonatelloNative_Selector( 133): Removing selector for fd 33
04-28 07:47:10.815 D/DonatelloNative_Selector( 133): Removing selector for fd 32
04-28 07:47:10.815 W/InputDispatcher( 464): channel 'b3268bf0 SchoolOfFineArt.Droid/md51c583ee22c53a99167a61678b0024deb.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
04-28 07:47:10.815 E/InputDispatcher( 464): channel 'b3268bf0 SchoolOfFineArt.Droid/md51c583ee22c53a99167a61678b0024deb.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
04-28 07:47:10.815 W/InputDispatcher( 464): Attempted to unregister already unregistered input channel 'b3268bf0 SchoolOfFineArt.Droid/md51c583ee22c53a99167a61678b0024deb.MainActivity (server)'
04-28 07:47:10.815 I/WindowState( 464): WIN DEATH: Window{b3268bf0 u0 SchoolOfFineArt.Droid/md51c583ee22c53a99167a61678b0024deb.MainActivity}
04-28 07:47:10.815 I/ActivityManager( 464): Process SchoolOfFineArt.Droid (pid 1239) has died.
04-28 07:47:10.815 W/ActivityManager( 464): Force removing ActivityRecord{b337aba8 u0 SchoolOfFineArt.Droid/md51c583ee22c53a99167a61678b0024deb.MainActivity t2}: app died, no saved state
04-28 07:47:10.859 D/Zygote ( 138): Process 1239 terminated by signal (11)
04-28 07:47:10.863 W/EGL_emulation( 663): eglSurfaceAttrib not implemented
04-28 07:47:10.863 W/InputMethodManagerService( 464): Got RemoteException sending setActive(false) notification to pid 1239 uid 10087
04-28 07:47:10.867 W/Binder ( 634): Caught a RuntimeException from the binder stub implementation.
04-28 07:47:10.867 W/Binder ( 634): java.lang.NullPointerException
04-28 07:47:10.867 W/Binder ( 634): at android.inputmethodservice.IInputMethodWrapper.setSessionEnabled(IInputMethodWrapper.java:280)
04-28 07:47:10.867 W/Binder ( 634): at com.android.internal.view.IInputMethod$Stub.onTransact(IInputMethod.java:129)
04-28 07:47:10.867 W/Binder ( 634): at android.os.Binder.execTransact(Binder.java:404)
04-28 07:47:10.867 W/Binder ( 634): at dalvik.system.NativeStart.run(Native Method)
以下是我的应用程序的一些代码:
带有listview小部件的Xaml代码:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:school="clr-namespace:SchoolOfFineArt;assembly=SchoolOfFineArt"
x:Class="SchoolOfFineArt.StudentListPage">
<ContentPage.Padding>
<OnPlatform x:TypeArguments="Thickness" iOS="0, 20, 0, 0" />
</ContentPage.Padding>
<ContentPage.BindingContext>
<school:SchoolViewModel />
</ContentPage.BindingContext>
<StackLayout BindingContext="{Binding StudentBody}">
<Label Text="{Binding School}" FontSize="Large" FontAttributes="Bold"
HorizontalTextAlignment="Center" />
<ListView ItemsSource="{Binding Students}">
<ListView.ItemTemplate>
<DataTemplate>
<ImageCell ImageSource="{Binding PhotoFilename}"
Text="{Binding FullName}"
Detail="{Binding GradePointAverage, StringFormat='G.P.A. = {0:F2}'}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage>
xaml页面的C#代码隐藏代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace SchoolOfFineArt
{
public partial class StudentListPage : ContentPage
{
public StudentListPage()
{
InitializeComponent();
}
}
}
我不知道如何逐步执行,但看起来它们在调用完成后会立即创建。这两个异步操作可能在studentBody中相互作用。学生:可能正在添加枚举。请仅在第一个异步操作完成后尝试启动第二个异步操作。我不知道如何逐步执行,但是,调用完成后,它们看起来是一次创建的。这两个异步操作可能在studentBody中相互重叠。学生:可能正在添加枚举。请仅在第一个异步操作完成后,尝试启动第二个异步操作
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace SchoolOfFineArt
{
public partial class StudentListPage : ContentPage
{
public StudentListPage()
{
InitializeComponent();
}
}
}