アンドロイド: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. Listviewは、アイテムの代わりにonclickを指定しました
- 2. ラジオボタンでクリアテキスト領域をクリックして値の代わりにテキストを取得jquery
- 3. テキストの代わりにツールチップイメージ
- 4. 代わりにフルページまたは親指
- 5. composer.jsonの代わりに使うComposerオプション?
- 6. オプション連鎖(if/elseの代わりに)
- 7. Java 8オプションの代わりに
- 8. curosrは開始の代わりにテキスト領域の中央を指します
- 9. ActiveSupport :: TimeWithZoneにタイムゾーンの代わりにUTCオフセットを指定する
- 10. Log4jは指定されたファイル名の代わりにlog4j.logにログします
- 11. matplotlibでfigsizeの代わりにサブプロットサイズを指定する
- 12. カーブしたテキストの代わりにクロックを描く時計の代わりにカウンタークロックを描く
- 13. ラジオボタンの代わりにマウスオーバーしますか?
- 14. iMacros:値の代わりに表示テキストでオプションを選択できますか?
- 15. テキストの代わりにCSSのvalign
- 16. UITabBarItem画像の代わりに上記のテキストの代わりに
- 17. Rails 5サーバーは指定されたポートの代わりにデフォルトのポートに切り替わります
- 18. テキストの代わりに記号Excel 2016
- 19. テキストの代わりに、IDは
- 20. NG-オプション - これはNG-オプションでキーの代わりに、値
- 21. チェックボックスの代わりにラジオボタンを使用する方法
- 22. OledbCommandでExcelシート名を指定する代わりの方法
- 23. JQueryを使わずにラジオボタンの代わりに画像を表示
- 24. 任意の指定されたif-elseステートメントに代わる
- 25. オプションのパラメータを指定したSqlアップデートコマンド?
- 26. 〜/ .jfrog_accessの代わりにJFROG_ACCESS homeを指定してください(Artifactory 5.5.2)
- 27. WooCommerceカート-shipping.phpテンプレート - ラジオボタンの代わりに、選択ボックス
- 28. 位置指定イメージ代替テキスト
- 29. 合わせラジオボタンのオプションやスライダー
- 30. three.js:パーティクルの代わりにパーティクルクラウドにテキストを渡します。
あなたが動的に行うにしたい場合、それは、あなたが使用@Anuの答えを使用できることを意味します。そして、あなたのjavaファイルに。そのidを使って 'ImageView'を見つけ、そのためのimagesourceを使います。 – Praveenkumar
ありがとうございます。私は今これを試してみます。 :) –