Seçilen öğeyi ListView'de temizlemenin bir yolu var mı?Clear SingleChoice ListView Selection
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minHeight="50dp"
android:id="@+id/example_list"
android:layout_weight="2"
android:choiceMode="singleChoice"/>
Ve özel Adaptörü kullanılarak doldurulur:
ListView böyle tanımlanır.
seçilen öğe bir Seçici kullanılarak vurgulanır: Gerçekten ne Şimdi
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<gradient
android:startColor="#3E5260"
android:endColor="#3E5260"
android:angle="270" />
</shape>
</item>
<item android:state_activated="true">
<shape>
<gradient
android:startColor="#3E5260"
android:endColor="#3E5260"
android:angle="270" />
</shape>
</item>
</selector>
tek bir etkinlikte 2 listviews ve bir öğenin bir ListView seçilen
olduğunda ben öğeyi seçimini istiyorum diğer ListView.
void DeviceList_Click(object sender, EventArgs e)
{
//easy enough to check which ListView raised the event
//but then I need to deselect the selected item in the other listview
}
gibi şeyler denedim:
Hem listviews bir öğe tıklandığında aşağıdaki işleyici yükseltmek
exampleList.SetItemChecked(exampleList.SelectedItemPosition, false);
ve
exampleList.SetSelection(-1);
Ama bu görünmüyor çalışmak.
Bu işe yaramadı, bunu denemedi, teşekkürler – TimothyP
Nedir => notasyonu? Android kodunda kullanıldığını hiç görmedim. –
@IgorGanapolsky Bu bir lambda ifadesidir, anonim bir yöntemdir. Bu C# Java'da 'IOnClickListener' uygulamalarına sahipsiniz. – Cheesebaron