zoukankan      html  css  js  c++  java
  • android studio IDE 下,设置ACTIVITY全屏

    因为ANDROID STUDIO的JAVA类是继承AppCompatActivity的 ,所以常规的全屏设置并不管用。如果要设置全屏,请参照如下代码/

    1/首先,打开AndroidManifest.xml文件添加代码“android:theme="@style/AppTheme"”这个属性,这个APPTHRME是自定义属性,其整个XML代码如下

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="entss.ent.core.apps.unisi.com.myapplication">
    
        <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">
            <activity android:name=".SplashActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name=".MainActivity"></activity>
        </application>
    
    </manifest>

    2/设置STYLE属性

    <resources>
        <!-- Base application theme. -->
        <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
            <!-- #region /设置全屏属性-->
            <item name="android:windowFullscreen">true</item>
            <!--#endregion -->
            <item name="colorPrimary">@color/colorPrimary</item>
            <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
            <item name="colorAccent">@color/colorAccent</item>
        </style>
    </resources>

    OK,如上配置后运行APPS就可以看到全屏了。

  • 相关阅读:
    MyBatis-Plus使用(4)-集成SpringBoot
    MyBatis-Plus使用(3)-条件构造器
    Logback日志格式优化,解决输出***@2b193f2d问题
    MyBatis-Plus使用(2)-CRUD接口
    数组
    switch结构
    if的使用
    new函数
    指针
    常量和iota
  • 原文地址:https://www.cnblogs.com/fan-yuan/p/5105190.html
Copyright © 2011-2022 走看看