मैं नई एंड्रॉइड डेटा बाइंडिंग लाइब्रेरी का उपयोग करने की कोशिश कर रहा हूं और चयनित त्रुटि के साथ स्पिनर को पॉप्युलेट करने का प्रयास करने में निम्न त्रुटि प्राप्त कर रहा हूं।एंड्रॉइड स्पिनर के साथ DataBindingUtil का उपयोग कैसे करें?
त्रुटि संदेश (एंड्रॉयड स्टूडियो में संकलन के दौरान): वहाँ बाहर
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="receipt"
type="com.example.model.Receipt" />
</data>
</LinearLayout>
<Spinner
android:layout_width="wrap_content"
android:id="@+id/currency"
android:layout_height="wrap_content"
android:spinnerMode="dropdown"
android:entries="@array/currency_array"
app:selection="@{receipt.currency}" />
</LinearLayout>
</layout>
किसी को भी है कि सफल रही है डेटा के लिए बाध्य पाने के लिए:
Error:Execution failed for task ':app:compileDebugJavaWithJavac'. java.lang.RuntimeException: Found data binding errors. ****/ data binding error ****msg:Cannot find the setter for attribute 'app:selection' with parameter type java.lang.String. file:/Users/ove/Code/AndroidStudio/Samples/Receipts/app/src/main/res/layout/dialogfragment_inputamount_db.xml loc:40:29 - 40:44 ****\ data binding error ****
मेरे लेआउट फ़ाइल निम्न (पूरा नहीं) लग रहा है स्पिनरों के साथ काम करते हो?
ओव
यह एक तरह से बाध्यकारी, कैसे दो तरह बाध्यकारी के लिए काम करेगा ?? स्पिनर में एक आइटम का चयन मॉडल को अद्यतन करता है। –