设置APP全屏无标题
程序员文章站
2022-07-14 17:41:57
...
1、修改styles.xml文件
<style name="AppTheme">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
2、修改AndroidManifest.xml下application节点
<application
android:name=".app.MeetingApp"
android:allowBackup="true"
android:icon="@drawable/app_logo"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
.....
3、修改BaseActivity
public abstract class BaseActivity extends AppCompatActivity
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//设置标题栏
requestWindowFeature(Window.FEATURE_NO_TITLE);
//设置状态栏
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
//设置布局
setContentView(intiLayout());
......
上一篇: 无标题全屏错误
下一篇: leetcode9.回文数