La vista de imagen y la vista de texto no se muestran en la vista?

Estoy intentando inflar un diseño y agregarlo a la vista de la cuadrícula que se puede arrastrar Pero todo lo que obtengo es un cuadrado amarillo. El método addView () de la vista que se puede arrastrar solo está recogiendo una sola vista. Por ejemplo, si agrego un textView o imageView, se mostrará la vista de texto. Si agrego un diseño lineal, solo se mostrará el fondo de pantalla (también conocido como linearlayout) de linearlayout. Pero no los niños de linearlayouts (imagen y vista de texto). El dgv (arrastre Gridview) extiende ViewGroup Aquí está el código:

adición de diseño lineal:

LayoutInflater inflater = LayoutInflater.from (getActivity ());
View cellView = inflater.inflate (R.layout.celllayout, null);
if (cellView != null)
Log.d ("Snap", "cellView != null");
TextView textView = (TextView) cellView.findViewById (R.id.grid_label);
textView.setText (word);
ImageView imageView =  (ImageView) cellView.findViewById (R.id.grid_image);
imageView.setImageBitmap (getThumb (word));

dgv.addView (cellView);

Diseño lineal:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFF000"
android:gravity="center"
android:orientation="vertical"
android:padding="5dp" >

<TextView
android:id="@+id/grid_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dip"
android:text="@string/grid_label"
android:textColor="#c31d36"
android:textSize="15sp" />
<ImageView
android:id="@+id/grid_image"
android:layout_width="150dip"
android:layout_height="150dip"
android:layout_gravity="center_horizontal"
android:contentDescription="An Image" 
android:background="#ffff0000"/>

</LinearLayout>

dgv:

@Override
public void addView (View child) {
    super.addView (child);
    Log.d ("Draggable", "Draggable-addView");

    newPositions.add (-1);
}

¿Algunas ideas? ¿Necesito proporcionar más información? Mi única solución es personalizar la vista de imagen y anular ondraw y hacer lo que quiero. Pero eso es tan hacky y no escalable. Cualquier ayuda sería apreciada.

Respuestas a la pregunta(1)

Su respuesta a la pregunta