80,471
社区成员




public GridViewTest(Context context, AttributeSet attrs) {
super(context, attrs);
LayoutInflater inflater = LayoutInflater.from(context);
View gv;
gv = inflater.inflate(R.layout.mycalander, null);
tvItemList = (GridView) gv.findViewById(R.id.date_item);
tvItemList.setAdapter(new TvItem(getContext()));
addView(gv);
}
TvItem相关
public View getView(int position, View convertView, ViewGroup parent) {
TextView tv;
if(convertView == null){
tv = new TextView(c);
tv.setWidth(diel);
tv.setHeight(diel);
tv.setText("text");
tv.setBackgroundColor(Color.YELLOW);
tv.setGravity(Gravity.CENTER);
}else{
tv = (TextView) convertView;
}
return tv;
}