我一直关注Xamarin的指南,但我无法引用RecyclerView来创建它的实例。
安装了JDK 8。我已经安装了Xamarin.Android.Support.v7.RecyclerView包及其所有依赖项。我的目标是API级别24.但仍然没有骰子。
我在网上找不到任何引用此问题的内容。有什么想法吗?
using System;
using System.Collections.Generic;
using System.Data;
using System.Threading.Tasks;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Support.V7.RecyclerView;
using Android.Views;
using Android.Widget;
namespace ArbanQC
{
[Activity(Label = "LoadsActivity")]
public class LoadsActivity : Activity
{
ProgressDialog progress;
bool ScheduleShowing;
RecyclerView grid; //Namespace is not recognized here.
List<Load> loads = new List<Load>();
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
RequestWindowFeature(WindowFeatures.NoTitle);
SetContentView(Resource.Layout.Loads);
grid = FindViewById<RecyclerView>(Resource.Id.loadsGrid); //Also not recognized here
ScheduleShowing = true;
}
}
}
答案 0 :(得分:3)
您的使用指令:
using Android.Support.V7.RecyclerView;
不正确 - 它应该是:
using Android.Support.V7.Widget;