0
我有我的MainActivity像在android中如何添加Vertical ViewPager?
public class MainActivity extends SlidingFragmentActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
// Main layout
setContentView(R.layout.activity_main);
setBehindContentView(R.layout.menu_frame);
// SlidingMenu
sm = getSlidingMenu();
sm.setFadeDegree(0.35f);
sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
sm.setBehindOffset(120);
sm.setMode(SlidingMenu.LEFT_RIGHT);
// Left menu
getSupportFragmentManager().beginTransaction()
.replace(R.id.menu_frame, new LeftMenuFragment()).commit();
// Right menu
getSlidingMenu().setSecondaryMenu(R.layout.menu_frame_second);
getSupportFragmentManager().beginTransaction()
.replace(R.id.menu_frame_two, new RightMenuFragment()).commit();
}
}
我怎么能在这个活动创建垂直寻呼机?我也想在两个布局(片段)之间滚动垂直。
我尝试使用该库,但我有库冲突[https://github.com/jfeinstein10/SlidingMenu。他们都使用android-support-v4库。 – cashmere
有一个分叉,它修复了兼容性问题:https://github.com/keiththompson/Android-DirectionalViewPager/commit/6ef2b4a3a16616b3f190b26c8e194230852e342f –
垂直导航有很好的项目https://github.com/grantland/android-verticalpager – cashmere