开发者

The tabhost hides when app it's on full screen

I have a problem with a TabHost and a full screen app on Android. I download this example: https://github.com/AdilSoomro/Iphone-Tab-in-Android and I add this lines on onCreate:

 requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

but when I try in on my HTC mobile phone, the tabs are hidden. This don't happen if application aren't on full screen. You can see it on this screenshot.

The tabhost hides when app it's on full screen

Suddenly when I press on another tab, all the TabHost go up. The extrange is this only happend on HTC mobile, I tested on: HTC G1, HTC Hero, HTC Desire and HTC Desire HD, on the other hand, on Samsung Galaxy 3 and S II I haven't t开发者_StackOverflow中文版his error.

Do you know where is the problem?I could not find anything about this.

Thanks.


Instead of trying to remove the title in the code, have you tried removing the title in the Manifest?

<activity android:name="TabActivityName"
      android:label="@string/name_of_acitivity"
      android:theme="@android:style/Theme.NoTitleBar">

For more information checkout: http://developer.android.com/guide/topics/ui/themes.html#PlatformStyles


I've had the same problem. I think android don't know the size of the screen while animating the hide of statusbar, when the tabbar is at the bottom.

The easiest solution is to hide the tabbar first: tabHost.getTabWidget().setVisibility(View.GONE); . Then enable it after about 600msec: tabHost.getTabWidget().setVisibility(View.VISIBLE);. It is not the best if you have a stretched background image, because the height of the content will change so the image will jump to the new size.

The other solution is to make a splash screen activity before your app starts. You need to make this screen full screen. Here is a link, how to make a splash screen: http://www.codeproject.com/Articles/113831/An-Advanced-Splash-Screen-for-Android-App I made a fullscreen splash image and needed to put the finish() after startActivity(intent) line. This solved the above problem for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜