我需要实现的目标:
我设法实现的目标:
Custom spinner喜欢Google地图。但我无法使用ActionBar.NAVIGATION_MODE_TABS
ActionBar bar = this.getSupportActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
MyCustomAdapter a2 = new MyCustomAdapter(this,
R.layout.mainmenu_dropdownfull, string,
Constants.dropdown_title,
Constants.dropdown_icon,
Constants.dropdown_description);
MyOnNavigationListener mNavigationCallback = new MyOnNavigationListener();
bar.setListNavigationCallbacks(a2, mNavigationCallback);
Swipe tabs但它看起来不像我需要的:微调器位于标签下方。
ActionBar bar = this.getSupportActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
bar.setDisplayShowCustomEnabled(true);
bar.setCustomView(R.layout.bar_customview);
mViewPager = new ViewPager(getApplicationContext());
adapter = new TabsAdapter(this, mViewPager ); //this is my custom class, extended from FragmentPagerAdapter
mViewPager.setAdapter( adapter );
mViewPager.setOnPageChangeListener( adapter );
mViewPager.setId( 0x7F04FFF2 );
adapter.addTab( "Tab 1", BusRouteInfoFragment.class, TestFragment.createBundle( "Fragment 1 bus") );
adapter.addTab( "Tab 2", TestFragment.class, TestFragment.createBundle( "Fragment 2") );
adapter.addTab( "Tab 3", TestFragment.class, TestFragment.createBundle( "Fragment 3") );
我如何实现Google地图等布局?