事前定義された属性を使用して View オブジェクトを作成するベスト プラクティスは何ですか?
次のようなものを使いたい
View view = (View) inflater.inflate(R.layout.orangeview, container,
false);
しかし、オレンジ色のビューがビュー グループ内にある必要があるようで、レイアウト ファイル内にもっとスタンドアロンのものを用意したいと思います - 次のような唯一のビュー属性
<?xml version="1.0" encoding="utf-8"?>
<RadioButton
android:layout_width="fill_parent"
android:id="@+id/orangeradiobutton"
android:layout_weight="1"
android:button="@null"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/radiobutton_colors" />
それは可能ですか、それとも別のアプローチを使用する必要がありますか?