Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 当选择其他项目时,列表视图中的可绘制动画将移动_C#_Android_Xamarin_Xamarin.android_Mvvmcross - Fatal编程技术网

C# 当选择其他项目时,列表视图中的可绘制动画将移动

C# 当选择其他项目时,列表视图中的可绘制动画将移动,c#,android,xamarin,xamarin.android,mvvmcross,C#,Android,Xamarin,Xamarin.android,Mvvmcross,我试图在列表视图中的特定项目上显示动画。动画开始的方式是,当您点击列表视图中的某个项目时,按下按钮启动某个过程,动画开始 一切似乎都很顺利。我能够根据选定的项目启动动画。但这里有一个奇怪的行为,只要我点击列表视图中的另一个项目,动画就会随之移动 动画应粘贴到以前选定的项目。如果我在选择第二个项目时点击按钮,那么它应该会启动该项目的动画 列表视图有一个适配器,但该适配器的核心是GetBindableView方法,该方法基本上只设置背景颜色(没有什么特别之处): 以下是列表视图的xml: <M

我试图在列表视图中的特定项目上显示动画。动画开始的方式是,当您点击列表视图中的某个项目时,按下按钮启动某个过程,动画开始

一切似乎都很顺利。我能够根据选定的项目启动动画。但这里有一个奇怪的行为,只要我点击列表视图中的另一个项目,动画就会随之移动

动画应粘贴到以前选定的项目。如果我在选择第二个项目时点击按钮,那么它应该会启动该项目的动画

列表视图有一个适配器,但该适配器的核心是GetBindableView方法,该方法基本上只设置背景颜色(没有什么特别之处):

以下是列表视图的xml:

<Mvx.MvxListView
     android:id="@+id/listView1"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     local:MvxBind="ItemsSource Inspections; SelectedItem SelectedInspection; Visibility Visibility(PendingInsListViewVisible)"
     local:MvxItemTemplate="@layout/template_listview"
     style="@style/listview" />

以下是模板:

    <LinearLayout
        android:layout_width="0dp"
        android:layout_weight="1.5"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        style="@style/listview_item">
            <ImageView
                android:id="@+id/caching_anim"
                android:layout_width="0dp"
                android:layout_weight=".5"
                style="@style/caching_image" />
            <TextView
                android:layout_width="0dp"
                android:layout_weight=".5"
                style="@style/form_label.spacer" />
            <RelativeLayout
                android:layout_width="0dp"
                android:layout_weight=".5"
                android:layout_height="match_parent"
                android:gravity="center_vertical|center">
                <ImageView
                    android:id="@+id/imageButtonLock"
                    local:MvxBind="Visibility Visibility(BooleanValueToBoolean(Locked))"
                    android:src="@drawable/ic_lock"
                    style="@style/toggle_lock_image" />
                <ImageView
                    android:id="@+id/imageButtonUnLock"
                    local:MvxBind="Visibility Visibility(FinishedButNotLocked)"
                    android:src="@drawable/ic_unlock"
                    style="@style/toggle_lock_image" />
                <ImageView
                    android:id="@+id/blankImage"
                    local:MvxBind="Visibility Visibility(If(FinishedButNotLocked, false, true))"
                    android:src="@drawable/blank"
                    style="@style/toggle_lock_image" />
            </RelativeLayout>
            <TextView
                android:layout_width="0dp"
                android:layout_weight=".5"
                android:id="@+id/textView1"
                local:MvxBind="Text MarkerLabel"
                android:gravity="center"
                style="@style/listview_item.marker" />
        </LinearLayout>

动画正在ImageView上完成,Id为“caching_anim”

有人试过或见过这种行为吗?我应该怎么做才能使动画粘贴到特定的项目?我错过了什么?如果需要更多的澄清,请告诉我


提前谢谢

你能用做一个小的记录来了解动画是如何随着新的物品“移动”的吗?@AndreiN。很抱歉延迟了回复。我被其他事情缠住了。我的意思是,当您选择第1行时,点击一个按钮,这将在该行上启动动画。然后选择第2行。第1行中运行的动画消失,现在位于第2行。如果不知道如何更新缓存,我将无能为力_anim@AndreiN. 是的,这比我解释的要复杂得多。我正朝着另一个方向走,我认为这对我来说是可行的。非常感谢您花时间来帮助我。:)
    <LinearLayout
        android:layout_width="0dp"
        android:layout_weight="1.5"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        style="@style/listview_item">
            <ImageView
                android:id="@+id/caching_anim"
                android:layout_width="0dp"
                android:layout_weight=".5"
                style="@style/caching_image" />
            <TextView
                android:layout_width="0dp"
                android:layout_weight=".5"
                style="@style/form_label.spacer" />
            <RelativeLayout
                android:layout_width="0dp"
                android:layout_weight=".5"
                android:layout_height="match_parent"
                android:gravity="center_vertical|center">
                <ImageView
                    android:id="@+id/imageButtonLock"
                    local:MvxBind="Visibility Visibility(BooleanValueToBoolean(Locked))"
                    android:src="@drawable/ic_lock"
                    style="@style/toggle_lock_image" />
                <ImageView
                    android:id="@+id/imageButtonUnLock"
                    local:MvxBind="Visibility Visibility(FinishedButNotLocked)"
                    android:src="@drawable/ic_unlock"
                    style="@style/toggle_lock_image" />
                <ImageView
                    android:id="@+id/blankImage"
                    local:MvxBind="Visibility Visibility(If(FinishedButNotLocked, false, true))"
                    android:src="@drawable/blank"
                    style="@style/toggle_lock_image" />
            </RelativeLayout>
            <TextView
                android:layout_width="0dp"
                android:layout_weight=".5"
                android:id="@+id/textView1"
                local:MvxBind="Text MarkerLabel"
                android:gravity="center"
                style="@style/listview_item.marker" />
        </LinearLayout>