首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

程序中掩藏状态栏

2012-09-20 
程序中隐藏状态栏import android.app.Activity?import android.os.Bundle?import android.view.Window?

程序中隐藏状态栏

import android.app.Activity;?
import android.os.Bundle;?
import android.view.Window;?
import android.view.WindowManager;?
?
public class ActivityName extends Activity {?
? ? @Override?
? ? public void onCreate(Bundle savedInstanceState) {?
? ? ? ? super.onCreate(savedInstanceState);?
? ? ? ? // remove title?
? ? ? ? requestWindowFeature(Window.FEATURE_NO_TITLE);?
? ? ? ? getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,?
? ? ? ? ? ? WindowManager.LayoutParams.FLAG_FULLSCREEN);?
? ? ? ? setContentView(R.layout.main);?
? ? }?
}?
<activity android:name=".ActivityName"?
? ? android:label="@string/app_name"?
? ? android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">?
</activity>?

热点排行