1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > Android设置全屏显示

Android设置全屏显示

时间:2019-07-15 06:04:38

相关推荐

Android设置全屏显示

主要有两种方式:

第一种办法: 代码中设置:

requestWindowFeature(Window.FEATURE_NO_TITLE);// 隐藏标题

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,

WindowManager.LayoutParams.FLAG_FULLSCREEN);// 设置全屏

setContentView(R.layout.activity_main);

注意:setContentView一定要写在设置全屏后边

第二种办法:AndroidManifest.xml文件中设置

<application

android:allowBackup="true"

android:icon="@drawable/icon"

android:label="@string/app_name"

android:theme="@style/AppTheme"

android:name="com.scwindow.utility.CrashApplication" >

在res文件下的values文件下styles.xml文件中,定义一下AppTheme

<!-- Application theme. -->

<style name="AppTheme" parent="AppBaseTheme">

<!-- All customizations that are NOT specific to a particular API-level can go here. -->

<item name="android:windowNoTitle">true</item>

<item name="android:windowFullscreen">true</item>

<item name="android:windowIsTranslucent">true</item>

</style>

自己做了一款幼儿学习笔画生字古诗的APP,请大家支持一下,谢谢

​​​​​​​

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。