アンドロイド:setTextプロパティでラジオボタンにテキストを設定することができます。しかし、私はそこにテキストが表示されるイメージをしたい..私を助けてください?テキストの代わりにオプションを指定したラジオボタン
答えて
使用この:drawableRight:アンドロイドを使用して、この約1
<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
不都合にも、RadioButtonをLinearLayoutに配置すると、RadioGroupはネストされたボタンのチェック状態の管理を停止します。したがって、RadioGroupは現在役に立たない。
どのように?
<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>
画像がweb/urlから同期されている場合はどうなりますか? – Killer
正しい答えとして選択されたものよりも良い答え... –
- 1. composer.jsonの代わりに使うComposerオプション?
- 2. curosrは開始の代わりにテキスト領域の中央を指します
- 3. Log4jは指定されたファイル名の代わりにlog4j.logにログします
- 4. ラジオボタンの代わりにマウスオーバーしますか?
- 5. iMacros:値の代わりに表示テキストでオプションを選択できますか?
- 6. テキストの代わりにCSSのvalign
- 7. JQueryを使わずにラジオボタンの代わりに画像を表示
- 8. OledbCommandでExcelシート名を指定する代わりの方法
- 9. オプションのパラメータを指定したSqlアップデートコマンド?
- 10. Python argparse - オプションを指定してオプションを指定する
- 11. 位置指定イメージ代替テキスト
- 12. FPDFはPDFファイルの代わりにテキストを返します
- 13. selectedIndexの代わりに選択したテキストを使用します
- 14. デフォルトのToString()の代わりにデフォルトの空のDataTemplateを指定するDataTemplate
- 15. オプション指定した文字列
- 16. アイテムタグの代わりにアイテムラッパーレベルでSchema.orgプロパティを指定できますか?
- 17. ヤード:(doc /の代わりに)コンパイルされたドキュメントの別のパスを指定しますか?
- 18. CSS - テキストは、代わりに新しい行に
- 19. OpenCF.FTPの代わりに - 安定
- 20. EAVの代わりにユーザー定義フィールド?
- 21. アイコンの代わりにシステムトレーにテキストを書き込む
- 22. ヘッダ機能が指定されたファイル(PHP)の代わりにindex.phpにリダイレクトしています
- 23. ラジオボタンの代わりに星のイメージを表示する方法WPFの
- 24. クラスのインスタンス名の代わりにテキストを使用する
- 25. テキストの代わりにi18nの疑問符を付ける
- 26. Googleマップのマーカーの代わりにテキストを使用
- 27. Android:ボタンのテキストの代わりにイメージを使用
- 28. 値の代わりにセルのテキストを読む
- 29. Java ssh(jsch)がコンソールの代わりにUIにストリームを設定しました
- 30. の代わりに
あなたが動的に行うにしたい場合、それは、あなたが使用@Anuの答えを使用できることを意味します。そして、あなたのjavaファイルに。そのidを使って 'ImageView'を見つけ、そのためのimagesourceを使います。 – Praveenkumar
ありがとうございます。私は今これを試してみます。 :) –