3
내가 내 FragmentPagerAdapter의 작업을 진행하려고하지만, 예를 실생활에 쉽게에 조금 있습니다 FragmentPagerAdapter instantiateItem이 단편과 함께 사용하고 있습니까?
@Override
public Object instantiateItem(final ViewGroup container, final int position)
{
final LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
int resId = 0;
switch (position)
{
case 0:
resId = R.layout.favorites_fragment;
break;
case 1:
resId = R.layout.nearby_list_fragment;
break;
default:
throw new IllegalArgumentException("Index cant be mapped to fragement:" + position);
}
final View view = inflater.inflate(resId, null);
viewPager.addView(view, 0);
return view;
}
내가 파편 메신저를 사용하려는거야으로
이미 내가 팽창 찾을 수있는 모든 예를 들어 나의이 방법을 혼동 거기 조각을 만드는 대신보기. 이 작업을 수행하는 방법?PS : 임 ... 4.1 lib에는
감사를 ActionBarSherlock의를 사용하여, 옌스
정확히 당신이 뭘 하려는지
Arg,이 방법을 놓쳤습니다! 그것은 지금 작동합니다! 감사 니콜라이 – Kitesurfer