XML 없이 셀(View)을 만들어서 그리드 뷰에 전달 하려고 하는데...

아래와 같이 작성하면 잘 나올것 같은데... 이상하게 그리드 뷰에는 아무것도 나오질 않네요..

 

참고로 그리드 뷰에 xml 형태로 작성된 셀을 넣으면 정상적으로 나옵니다..

 

 

public View getView(int position, View convertView, ViewGroup parent) {
     View singleCell = convertView;

      if (singleCell == null) {
           singleCell = new SingleCell(mActivity);  
      }

      return singleCell;

}

 

 

// 그리드 뷰에 각각에 셀에 들어갈 View

 

class SingleCell extends View {

     public AppList_SingleCell(Context context) {
          super(context);
     }

     protected void onDraw(Canvas canvas) {
          canvas.drawColor(Color.YELLOW);
          Paint titleTxt = new Paint();
          titleTxt.setTextSize(20);
          titleTxt.setColor(Color.WHITE);
          canvas.drawText("테스트 글씨 출력", 0, 0, titleTxt);
      }

}