gpt4 book ai didi

android - MVVM 跨 java.lang.ClassNotFoundException : Mvx. MvxListView

转载 作者:太空狗 更新时间:2023-10-29 13:18:16 26 4
gpt4 key购买 nike

我尝试添加一个带有 MvxListView 和绑定(bind)的 fragment 。我正在使用 v4.0.0.0 beta2。

这是布局:

<?xml version="1.0" encoding="utf-8"?>
<Mvx.MvxListView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
local:MvxItemTemplate="@layout/accountlistitem"
local:MvxBind="ItemsSource AllAccounts;ItemClick OpenOverviewCommand" />

fragment :

public class AccountListFragment : MvxFragment
{
public new AccountListViewModel ViewModel
{
get { return (AccountListViewModel)base.ViewModel; }
set { base.ViewModel = value; }
}

public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
var ignore = base.OnCreateView(inflater, container, savedInstanceState);
return this.BindingInflate(Resource.Layout.AccountListLayout, null);
}
}

以及我如何在主要 Activity 中加载 fragment :

var fragmenTransaction = SupportFragmentManager.BeginTransaction();
fragmenTransaction.Add(Resource.Id.content_pane, accountListFragment);
fragmenTransaction.Commit();

这里是错误信息:

08-28 00:28:40.783 I/MonoDroid( 4281): Suppressed: java.lang.ClassNotFoundException: Mvx.MvxListView 08-28 00:28:40.783 I/MonoDroid( 4281): at java.lang.Class.classForName(Native Method) 08-28 00:28:40.783 I/MonoDroid( 4281): at java.lang.BootClassLoader.findClass(ClassLoader.java:781) 08-28 00:28:40.783 I/MonoDroid( 4281): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) 08-28 00:28:40.783 I/MonoDroid( 4281): at java.lang.ClassLoader.loadClass(ClassLoader.java:504) 08-28 00:28:40.783 I/MonoDroid( 4281): ... 29 more 08-28 00:28:40.783 I/MonoDroid( 4281): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

可以找到 GitHub 存储库 here

我错过了什么?我用另一个有工作 MvxListView 的项目检查了它,但没有发现任何区别......

最佳答案

尝试使用控件全名:

<?xml version="1.0" encoding="utf-8"?>
<cirrious.mvvmcross.binding.droid.views.MvxListView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
local:MvxItemTemplate="@layout/accountlistitem"
local:MvxBind="ItemsSource AllAccounts;ItemClick OpenOverviewCommand" />

关于android - MVVM 跨 java.lang.ClassNotFoundException : Mvx. MvxListView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32260540/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com