android全屏无标题


1,添加样式
 <!-- base -->
     <style name="AppBaseTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen">
        <item name="android:textColor">@android:color/black</item>
        <item name="android:textAppearance">@android:style/TextAppearance.Medium</item>
    </style>

2,在manifest中配置android:theme="@style/AppBaseTheme"
 <application
        android:theme="@style/AppBaseTheme"
        ... >

3,代码
// 不显示标题
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		// 全屏
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);

猜你喜欢

转载自zheyiw.iteye.com/blog/2042886