这个要看一下切换横屏时候的回调函数吧
解决方案 »
- 【100分求答案】问个关于notification和activity的小白问题,求指点
- Android有没类似IPhone中Game Center的apk,要求是外文的,谢谢!
- 操作framebuffer的求助贴
- 求助大虾,关于listView的一个问题!
- 问下做Android开发目前以何种语言为主?
- Android培训哪个机构比较好?
- 请教Android 搭建与开发 过程
- 最近在做锁屏应用,可以Home键不会屏蔽啊
- FragmentTransaction#replace和commit不生效
- Android仿照薄荷appBMI控件实现
- 内部类如何访问外部参数
- 4.0以上 App里如何屏蔽Home键
mActionBar = getActionBar(); mActionBar.setDisplayOptions(0);
if (mActionBar != null) {
mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
mActionBar.setDisplayHomeAsUpEnabled(false);
mActionBar.setDisplayShowTitleEnabled(false);
mActionBar.setDisplayShowHomeEnabled(false);
setTabSetting(R.drawable.timer_tab,R.string.menu_timer,TimerFragment.class,TIMER_TAB_INDEX);
setTabSetting(R.drawable.clock_tab,R.string.menu_clock,ClockFragment.class,CLOCK_TAB_INDEX); setTabSetting(R.drawable.stopwatch_tab,R.string.menu_stopwatch,StopwatchFragment.class,STOPWATCH_TAB_INDEX);
mActionBar.setSelectedNavigationItem(selectedIndex);
mTabsAdapter.notifySelectedPage(selectedIndex); }
}
private void setTabSetting(int imageId, int stringId, Class mclass, int index) {
final Tab tab = getActionBar().newTab();
LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View tabView = layoutInflater.inflate(R.layout.deskclock_action_tab, null);
ImageView tabImage = (ImageView) tabView.findViewById(R.id.tab_image);
//Drawable top = getResources().getDrawable(imageId);
tab.setContentDescription(stringId);
tabImage.setImageResource(imageId);
tab.setCustomView(tabView);
mTabsAdapter.addTab(tab, mclass, index);
}这个是deskclock_action_tab.xml<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center" > <ImageView
android:id="@+id/tab_image"
android:layout_width="341dip"
android:layout_height="match_parent"
android:gravity="center" />
</LinearLayout>