我想看到突出顯示,當我單擊ListView中的項目,但它不起作用。我搜索了很長時間來解決這個問題,但沒有任何幫助。如何突出顯示在Xamarin中的ListView項目Android
我在創建Android本機列表時沒有任何問題。 這是在Android本地項目上工作的佈局的XML。
<ListView
android:id="@+id/menuList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/img_logo_arkema"
android:layout_below="@+id/img_logo_paladin"
android:background="#ffffffff"
android:choiceMode="singleChoice" />
但是,這不起作用,當我在Xamarin.Android項目中創建相同的ListView。 以下是Xamarin.Android項目無法使用的佈局XML。
<ListView
android:id="@+id/menuList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@color/colorTopDivider"
android:dividerHeight="@dimen/right_menu_divider_size"
android:choiceMode="singleChoice" />
我開發的Xamarin.Android在Visual Studio 2015年
感謝您的幫助!
您是否收到任何錯誤消息?你能不能發佈你的適配器的代碼? –
感謝您的回覆,貓王。我沒有收到任何錯誤消息。 –