काम नहीं कर रहा है (कोई एक ListView, बस माता-पिता के लिए उन्हें जोड़ने) इस तरह के तत्वों की:TextView setTextColor() मैं प्रोग्राम के रूप में एक सूची बना
<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:layout_weight="1">
<TextView android:id="@+id/filiale_name"
android:layout_width="fill_parent" android:layout_height="wrap_content"/>
<TextView android:id="@+id/lagerstand_text"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:textSize="10sp" android:textColor="@color/red"/>
</LinearLayout>
इसके अलावा, मैं मूल्यों में कुछ रंग को परिभाषित किया है/colors.xml । जैसा कि आप देखते हैं, आईडी "lagerstand_text" के साथ टेक्स्ट व्यू ने डिफ़ॉल्ट रूप से लाल रंग को लाल रंग में सेट कर दिया है। यह काम करता है।
जब जावा में तत्वों बनाने, मैं
lagerstandText.setText("bla");
और कुछ तत्वों के लिए क्या मैं भी
lagerstandText.setTextColor(R.color.red);
और अन्य रंग है। जबकि जिन तत्वों पर मैं setTextColor() को कॉल नहीं करता हूं, वे लाल होते हैं, अन्य सभी ग्रे होते हैं, इससे कोई फर्क नहीं पड़ता कि मैंने कौन सा रंग चुना है (भले ही यह एक ही लाल हो)।
वह क्यों है?
तो मेरा जवाब के लिए helpfukl है आप उत्तर –