LinearLayout 内にカスタム コンポーネントを動的に追加したい。
これは、カスタムコンポーネントを挿入したい私のアクティビティのコードです:
 <LinearLayout
            android:id="@+id/layout_cartelle_immagini"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/border_bottom"
            android:orientation="vertical" >
        </LinearLayout>
これは私のカスタム コンポーネントです。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/border_bottom"
    android:layout_marginBottom="2dp"
    android:paddingRight="20dp"
    android:paddingLeft="20dp" >
    <TextView
        android:id="@+id/label_pathFolder"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:gravity="center"
        android:padding="20dp"
        android:textSize="25sp" />
    <Spinner
        android:id="@+id/spinner_level"
        android:layout_width="300dp"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@+id/btn_show_desc_img"
        android:entries="@array/n_level_array"
        android:padding="20dp"
        android:prompt="@string/n_level_prompt" />
    <ImageButton
        android:id="@+id/btn_show_desc_img"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@+id/btn_remove_folder"
        android:layout_marginLeft="20dp"
        android:layout_centerVertical="true"
        android:background="@drawable/button_press"
        android:contentDescription="@string/showDescImg"
        android:src="@drawable/ic_desc" />
    <ImageButton
        android:id="@+id/btn_remove_folder"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dp"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:background="@drawable/button_press"
        android:contentDescription="@string/showDescImg"
        android:src="@drawable/ic_delete" />
</RelativeLayout>
これは、コンポーネントを追加するために使用したコードです。
LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View root = findViewById(R.id.layout_cartelle_immagini);
View custom = vi.inflate(R.layout.custom_list_folder, null);
...
..
((ViewGroup) root).addView(custom, 0);
すべて正常に動作しますが、カスタム コンポーネントにはアプリケーションの同じテーマがありません。なぜですか?? そして、どうすればこの問題を解決できますか?
ありがとう。