मैं छवि के रूप में विकल्प के साथ एंड्रॉइड ऐप में रेडियो बटन कैसे जोड़ सकता हूं, पाठ नहीं .. हम टेक्स्ट को एंड्रॉइड द्वारा सेट बटन पर सेट कर सकते हैं: setText property। लेकिन मैं एक छवि को वहां प्रदर्शित करना चाहता हूं, पाठ नहीं .. कृपया मेरी मदद करें?पाठ के बजाय छवि के साथ रेडियो बटन
उत्तर
उपयोग करें:
<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/radio01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/radio02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
</LinearLayout>
</RadioGroup>
धन्यवाद .. मैं कोशिश करूँगा। –
+1 अच्छा जवाब। – Praveenkumar
दुर्भाग्य से रेडियोबटन को लाइनरलाउट में डालने का कारण बनता है कि रेडियो समूह नेस्टेड बटनों के चेक किए गए राज्यों को प्रबंधित करना बंद कर देगा। इसलिए रेडियो ग्रुप अब बेकार है। <रेडियोबटन एंड्रॉइड: drawableRight = "@ drawable/ic_launcher" का उपयोग करने पर विचार करें> यह avoids को लाइनरलाइट के लिए जरूरी है और रेडियो समूह नेस्टेड रेडियोबटन के प्रबंधन में अपना काम कर सकता है। – petrsyn
कैसे आप इसका उपयोग एंड्रॉयड के बारे में: drawableRight?
<RadioButton
android:id="@+id/map"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:drawableRight="@drawable/map" />
<RadioButton
android:id="@+id/satellite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@drawable/sat" />
</RadioGroup>
क्या होगा यदि छवियां वेब/यूआरएल से सिंक हो? – Killer
सही उत्तर के रूप में चुने गए से बेहतर उत्तर ... –
- 1. रेडियो बटन के लिए लेबल के अंदर पाठ इनपुट रखें?
- 2. रेडियो बटन
- 3. PHP फॉर्म हैंडलिंग के साथ रेडियो बटन
- 4. रेडियो बटन स्टाइलिंग
- 5. रेडियो बटन बटन के रूप में?
- 6. एंड्रॉइड में छवियों के साथ रेडियोग्रुप रेडियो बटन बनाना ... कैसे?
- 7. रेडियो बटन के केंद्र में छवि को कैसे आकर्षित करें
- 8. छवि और पाठ के साथ एचटीएमएल हाइपरलिंक
- 9. छवि के साथ WPF बटन
- 10. बदलें आकार: एंड्रॉइड रेडियो बटन
- 11. रेडियो बटन
- 12. रेडियो बटन
- 13. रेडियो बटन
- 14. रेडियो बटन के रूप में Django BooleanField?
- 15. विभिन्न छवियों के साथ रेडियो बटन को प्रतिस्थापित करना
- 16. रेडियो बटन के लिए विकल्प क्या हैं?
- 17. छवि, छवि बटन, और क्लिक करने योग्य छवि दृश्य के साथ बटन के बीच अंतर?
- 18. वाईआई रेडियो बटन
- 19. उपस्थिति "बटन" के साथ एक रेडियो बटन के आकार को नियंत्रित करने के लिए कैसे करें
- 20. Android में रेडियो बटन के साथ सबमेनू कैसे बनाएं?
- 21. इसी लेबल के साथ रेडियो बटन संरेखित करें
- 22. आईफोन ऐप में रेडियो बटन
- 23. आईफोन ऐप में रेडियो बटन का उपयोग
- 24. जावास्क्रिप्ट के माध्यम से रेडियो बटन
- 25. रेडियो बटन चुना गया?
- 26. रेडियो बटन + सरणी तत्व
- 27. छुपाएं() रेडियो बटन * और * jquery
- 28. jQuery/जावास्क्रिप्ट - रेडियो बटन
- 29. जावास्क्रिप्ट jquery रेडियो बटन
- 30. बूटस्ट्रैप रेडियो बटन
आप गतिशील रूप से इसका मतलब है कि ऐसा करने के लिए चाहते हैं, आप का उपयोग उपयोग @Anu जवाब कर सकते हैं। और, आपकी जावा फाइल में। बस अपनी आईडी के साथ 'छवि दृश्य' ढूंढें और इसके लिए छवि स्रोत का उपयोग करें। – Praveenkumar
बहुत बहुत धन्यवाद .. मैं अब कोशिश करूँगा। :) –