• 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就可以看到全屏了。

  • 相关阅读:
    7.18学习日志
    7.16学习日志
    5 Things They Never Tell You About Making iPhone Apps
    MantisBT
    25款实用的桌面版博客编辑器
    【转】如何学会600多种编程语言
    开发者如何提升和推销自己
    CleanMyMac 1.10.8
    VMWARE FUSION 6 KEY
    cocos2dx shader
  • 原文地址:https://www.cnblogs.com/fan-yuan/p/5105190.html
Copyright © 2020-2023  润新知