//리스트뷰 getView
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
LayoutInflater inflater = context.getLayoutInflater();
if (convertView == null) {
convertView = inflater.inflate(R.layout.grid_adapter, null);
holder = new ViewHolder();
holder.SHOP_NAME = (TextView) convertView.findViewById(R.id.txt);
holder.pager = (ViewPager) convertView.findViewById(R.id.pager);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.SHOP_NAME.setText("HI");
holder.pager.setAdapter(new FullScreenImageAdapter(context)); //여기!!
return convertView;
}
//Viewpager의 Adapter
public class FullScreenImageAdapter extends PagerAdapter {
private Activity _activity;
private LayoutInflater inflater;
// constructor
public FullScreenImageAdapter(Activity activity) {
this._activity = activity;
}
@Override
public int getCount() {
return 4;
}
@Override
public boolean isViewFromObject(View view, Object object) {
return view == ((RelativeLayout) object);
}
//
@Override
public View instantiateItem(ViewGroup container, int position) {
ImageView imgDisplay;
Button btnClose;
inflater = (LayoutInflater) _activity
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View viewLayout = inflater.inflate(R.layout.layout_fullscreen_image,
container, false);
imgDisplay = (ImageView) viewLayout.findViewById(R.id.imgDisplay1);
btnClose = (Button) viewLayout.findViewById(R.id.btnClose1);
((ViewPager) container).addView(viewLayout);
return viewLayout;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
((ViewPager) container).removeView((RelativeLayout) object);
}
}
리스트뷰 getView에
Textview 와 Viewpager를 넣었는데 Viewpager는 보이질 않습니다.
Viewpager에는 이미지와 버튼이 있구요..
Viewpager를 리스트뷰에 넣지않고 메인에서 하면 잘 보이구요..
결합하는데 문제가 있는것 같습니다.. 어떻게 해야 보일까요..?