如果这真的是一个简单的问题,我很抱歉,但我是新手。我正在使用ViewPager和片段为我的应用程序正常滑动页面,如下面的动画所示 http://developer.android.com/training/animation/screen-slide.html
但是我想要更喜欢的东西,就像在书中或类似的东西。我搜索了很多,但没有找到任何有用的东西。对于简单的滑动我有以下
public class ManmohanSingh extends FragmentActivity {
SectionsPagerAdapter mSectionsPagerAdapter;
static ViewPager mViewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.manmohan_singh);
mSectionsPagerAdapter = new SectionsPagerAdapter(
getSupportFragmentManager());
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);
}
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
public Fragment getItem(int position) {
Fragment manmohanAng = new ManmohanAng(position);
return manmohanAng;
}
@Override
public int getCount() {
return 1431;
}
@Override
public CharSequence getPageTitle(int position) {
Locale l = Locale.getDefault();
for (int i = 1; i <= 1431; i++) {
if (position == i) {
return "Ang " + position;
}
}
return null;
}
}
答案 0 :(得分:0)
结帐http://www.androidviews.net/2013/02/jazzyviewpager/
如果它没有您需要的动画,您可以查看源代码以了解它是如何完成的。