我一直收到此错误消息。我借调了一周的工作,真的需要帮助。非常感谢我得到的任何东西。
这是cs代码
public class PhotoViewHolder : RecyclerView.ViewHolder
{
public ImageView Image { get; set; }
public TextView Caption { get; set; }
public PhotoViewHolder(View itemView,Action<int> listener) : base (itemView)
{
Image = itemView.FindViewById<ImageView>(Android.Resource.Id.imageView);
Caption = itemView.FindViewById<TextView>(Android.Resource.Id.textView);
itemView.Click += (sender, e) => listener(base.Position);
}
}
这是axml代码
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:layout_width="Match_content"
android:layout_height="wrap_content"
card_view:cardElevation =" 4dp"
card_view:cardUseComppatPadding="true"
card_view:cardCornerRadius="5dp"
>
<LinearLayout
android:layout_width="Match_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp"
>
<ImageView
android:layout_width="Match_parent"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:scaleType="fitCenter"
/>
<TextView
android:layout_width="Match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:att/textAppearanceMedium"
android:textColor="#333333"
android:text="Caption"
android:id="@+id/textView"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="4dp"
/>
</LinearLayout>
>
如果您有任何疑问,请随时给我发消息