作者:lbjf_887 | 来源:互联网 | 2023-07-31 14:36
本文整理了Java中android.support.v7.app.ActionBar.addTab()
方法的一些代码示例,展示了ActionBar.addTab()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ActionBar.addTab()
方法的具体详情如下:
包路径:android.support.v7.app.ActionBar
类名称:ActionBar
方法名:addTab
ActionBar.addTab介绍
暂无
代码示例
代码示例来源:origin: journeyapps/zxing-android-embedded
actionBar.addTab(
actionBar.newTab()
.setText(mSectionsPagerAdapter.getPageTitle(i))
代码示例来源:origin: tupunco/tup.dota2recipe
public void addTab(ActionBar.Tab tab, Class> clss, Bundle args) {
TabInfo info = new TabInfo(clss, args);
tab.setTag(info);
tab.setTabListener(this);
mTabs.add(info);
mActionBar.addTab(tab);
notifyDataSetChanged();
}
代码示例来源:origin: openbmap/radiocells-scanner-android
public void addTab(ActionBar.Tab tab, Class> clss, Bundle args) {
TabInfo info = new TabInfo(clss, args);
tab.setTag(info);
tab.setTabListener(this);
mTabs.add(info);
mActionBar.addTab(tab);
notifyDataSetChanged();
}
代码示例来源:origin: livroandroid/5ed
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActionBar actiOnBar= getSupportActionBar();
actionBar.setTitle("Hello ActionBar");
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
// Cria as tabs (Passa como parâmetro o índice de cada tab: 1,2,3)
actionBar.addTab(actionBar.newTab().setText("Tab 1").setTabListener(new MyTabListener(this, 1)));
actionBar.addTab(actionBar.newTab().setText("Tab 2").setTabListener(new MyTabListener(this, 2)));
actionBar.addTab(actionBar.newTab().setText("Tab 3").setTabListener(new MyTabListener(this, 3)));
}
代码示例来源:origin: ribot/easy-adapter
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(new MyPageAdapter(getSupportFragmentManager()));
mViewPager.setOnPageChangeListener(mPageChangeListener);
final ActionBar actiOnBar= getSupportActionBar();
if (actionBar!= null) {
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.addTab(actionBar
.newTab()
.setText(getString(R.string.tab_1_name))
.setTabListener(mTabListener));
actionBar.addTab(actionBar
.newTab()
.setText(getString(R.string.tab_2_name))
.setTabListener(mTabListener));
}
}
代码示例来源:origin: TheMorpheus407/Tutorials
actionBar.addTab(actionBar.newTab().setText("Tab " + i).setTabListener(tabListener));
代码示例来源:origin: livroandroid/5ed
actionBar.addTab(actionBar.newTab().setText("Frag 1").setTabListener(new MyTabListener(viewPager, 0)));
actionBar.addTab(actionBar.newTab().setText("Frag 2").setTabListener(new MyTabListener(viewPager, 1)));
actionBar.addTab(actionBar.newTab().setText("Frag 3").setTabListener(new MyTabListener(viewPager, 2)));
代码示例来源:origin: livroandroid/5ed
actionBar.addTab(actionBar.newTab().setText(getString(R.string.classicos)).setTabListener(new MyTabListener(viewPager,0)));
actionBar.addTab(actionBar.newTab().setText(getString(R.string.esportivos)).setTabListener(new MyTabListener(viewPager,1)));
actionBar.addTab(actionBar.newTab().setText(getString(R.string.luxo)).setTabListener(new MyTabListener(viewPager,2)));
代码示例来源:origin: livroandroid/5ed
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActionBar actiOnBar= getSupportActionBar();
actionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_TABS);
// Tab 1
ActionBar.Tab tab1 = actionBar.newTab().setText("Frag 1");
tab1.setTabListener(new MyTabListener(this, new Fragment1()));
actionBar.addTab(tab1);
// Tab 2
ActionBar.Tab tab2 = actionBar.newTab().setText("Frag 2");
tab2.setTabListener(new MyTabListener(this, new Fragment2()));
actionBar.addTab(tab2);
// Tab 3
ActionBar.Tab tab3 = actionBar.newTab().setText("Frag 3");
tab3.setTabListener(new MyTabListener(this, new Fragment3()));
actionBar.addTab(tab3);
}
}
代码示例来源:origin: livroandroid/5ed
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActionBar actiOnBar= getSupportActionBar();
actionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_TABS);
// Tab 1
ActionBar.Tab tab1 = actionBar.newTab().setText("Frag 1");
tab1.setTabListener(new MyTabListener(this, new Fragment1()));
actionBar.addTab(tab1);
// Tab 2
ActionBar.Tab tab2 = actionBar.newTab().setText("Frag 2");
tab2.setTabListener(new MyTabListener(this, new Fragment2()));
actionBar.addTab(tab2);
// Tab 3
ActionBar.Tab tab3 = actionBar.newTab().setText("Frag 3");
tab3.setTabListener(new MyTabListener(this, new Fragment2()));
actionBar.addTab(tab3);
}
}
代码示例来源:origin: SMSTicket/sms-ticket
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setup actionbar tabs
ActionBar bar = getSupportActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
bar.addTab(bar.newTab().setText(getString(R.string.tab_tickets)).setTabListener(mTabListener));
bar.addTab(bar.newTab().setText(getString(R.string.tab_statistics)).setTabListener(mTabListener));
if (savedInstanceState != null) {
mSelectedTab = savedInstanceState.getInt("selectedTab", TAB_TICKETS);
}
bar.setSelectedNavigationItem(mSelectedTab);
handleIntent(getIntent());
UpdateService.call(this, false);
checkForHigherPriorityReceivers();
checkForSim();
checkForEula();
}
代码示例来源:origin: purrprogramming/voice-pitch-analyzer
actionBar.addTab(
actionBar.newTab()
.setText(mSectionsPagerAdapter.getPageTitle(i))