में चयनित आइटम को हाइलाइट करने के लिए कैसे करें, मैं MvxListView
में कोई आइटम कैसे रख सकता हूं, जब तक कि इसे अचयनित नहीं किया जाता है या जब तक कोई अन्य आइटम नहीं चुना जाता है?किसी MvxListView
मेरे प्रोग्राम में MvxListView
है जो वस्तुओं की एक सूची को सही ढंग से प्रदर्शित करता है। उपयोगकर्ता इसे क्लिक करके एक आइटम का चयन कर सकते हैं, और उसके बाद एक सहेजें बटन क्लिक करें। चयनित आइटम MyChosenItem
में संग्रहीत किया जाता है जब तक कि इसे सहेजें बटन कोड द्वारा आवश्यक न हो। वर्तमान में, चयनित आइटम अचयनित रंग पर लौटने से पहले एक विभाजित दूसरे के लिए हाइलाइट रहता है।
यह MvxListView
कैसे बनाया जाता है:
<Mvx.MvxListView
android:layout_width="match_parent"
android:layout_height="260dp"
android:layout_marginTop="40dp"
android:id="@+id/MyMvxListViewControl"
local:MvxBind="ItemsSource MyItems; SelectedItem MyChosenItem"
local:MvxItemTemplate="@layout/my_item_layout" />
यह Layout/my_item_layout.xaml
है:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res/Project.Ui.Droid"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="300.0dp"
android:layout_height="wrap_content"
android:padding="5dp"
android:textSize="20dp"
android:textColor="#000000"
local:MvxBind="Text Field1" />
<TextView
android:layout_width="250.0dp"
android:layout_height="wrap_content"
android:padding="5dp"
android:textSize="20dp"
android:textColor="#000000"
local:MvxBind="Text Field2" />
</LinearLayout>
http://stackoverflow.com/questions/5058291/highlight-listview-selected-row मदद करता है? – Stuart