मुझे this post जैसी ही समस्या है। मैं अपनी कस्टम अधिसूचना पाठ शैली को डिफ़ॉल्ट अधिसूचनाओं से मेल खाना चाहता हूं (मैं बस कुछ अतिरिक्त विचार जोड़ने जा रहा हूं)। दुर्भाग्य से मैं स्वीकार किए गए उत्तर को पूरी तरह से समझ नहीं पा रहा हूं। मुझे लगता है मैं XML कोड का तरीका नहीं जानते कि वास्तव में क्या जोड़ने के लिए है, लेकिन मतलब कर रहा हूँ ... डिफ़ॉल्ट अधिसूचना शैली का उपयोग कैसे करें?
स्वीकार किए जाते हैं जवाब कहते हैं, " समाधान में निर्मित शैलियों का उपयोग करने के लिए है। शैली आप की जरूरत TextAppearance.StatusBar है। EventContent। बस इस शैली को लागू करें और यह अधिसूचनाओं के लिए डिफ़ॉल्ट टेक्स्ट रंग सेट करेगा (एंड्रॉइड को न भूलें: निश्चित रूप से उपसर्ग)। "
मैं इसे काम करने के लिए नहीं मिल सकता! रेखा के नीचे अपने कस्टम अधिसूचना में? "एंड्रॉयड: textAppearance =" एंड्रॉयड: attr/textAppearanceLarge "काम करता है (के रूप में यह पाठ enlargens), लेकिन वांछित प्रभाव नहीं दे करता है
यहाँ मेरी कस्टम XML कोड है ...
।<ImageView
android:id="@+id/notImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_alignParentTop="true"/>
<TextView
android:id="@+id/notContentTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf ="@id/notImage"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/notContentText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below ="@id/notContentTitle"
/>
Custom notification layouts and text colors
बस हमें यह जानकारी कर रहे हैं स्पष्ट ... वहाँ API9 करने से पहले डिफ़ॉल्ट सूचना शैलियों का उपयोग करने के लिए कोई रास्ता नहीं है, सही है? –
दुर्भाग्य से, हाँ। जैसा कि मैंने अपने उत्तर में बताया है (http://stackoverflow.com/questions/4867338/custom-notification-layouts-and-text-colors/4935191#4935191), एपीआई स्तर 8 में और पहले केवल एक हार्ड-कोडित मूल्य है , जिसे एक्सेस नहीं किया जा सकता है। – Malcolm
उत्तर (http://stackoverflow.com/a/7320604/435605) 2.2- के लिए रंग खोजने का एक तरीका प्रदान करता है –