Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

setCurrentItem makes black background #11

Open
josluimg opened this issue May 28, 2015 · 0 comments
Open

setCurrentItem makes black background #11

josluimg opened this issue May 28, 2015 · 0 comments

Comments

@josluimg
Copy link

@Override
public View onCreateView(LayoutInflater inflater,
                         @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_home, container, false);

    parallaxHorizontalViewPager = ((ParallaxViewPager) view.findViewById(R.id.parallaxviewpager));

    parallaxHorizontalViewPager.setAdapter(new PageHorizontalHomeAdapter(getFragmentManager()));

    parallaxHorizontalViewPager.setScaleType(ParallaxViewPager.FIT_WIDTH);
    parallaxHorizontalViewPager.setBackgroundResource(R.drawable.image);
    return view;
}


@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    parallaxHorizontalViewPager.setCurrentItem(1, false);
}

setCurrentItem makes black background. It's like it can calculate the width or something

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant