zoukankan      html  css  js  c++  java
  • Cocos2d-x 3.1 修改程序名、图标和屏幕方向

    当做出一个游戏后,编译成apk安装在手机上,你会发现程序名和图标都是默认的,而放心默认是横屏,那么在哪里改呢?


    打开工程->proj.android,找到AndroidManifest.xml并打开:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.pianotiles.org"
          android:versionCode="1"
          android:versionName="1.0">
    
        <uses-sdk android:minSdkVersion="9"/>
        <uses-feature android:glEsVersion="0x00020000" />
    
        <application android:label="@string/app_name" 
                     android:icon="@drawable/icon"> 		
    					 
            <!-- Tell Cocos2dxActivity the name of our .so -->
            <meta-data android:name="android.app.lib_name"
    	              android:value="cocos2dcpp" />
    
            <activity android:name="org.cocos2dx.cpp.AppActivity"
                      android:label="@string/app_name"
                      android:screenOrientation="portrait"
                      android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
                      android:configChanges="orientation">
    
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    
        <supports-screens android:anyDensity="true"
                          android:smallScreens="true"
                          android:normalScreens="true"
                          android:largeScreens="true"
                          android:xlargeScreens="true"/>
    
        <uses-permission android:name="android.permission.INTERNET"/>
    </manifest> 
    

    先看application标签:

    android:label:应用程序名字,@string/app_name说明在string.xml定义了app_name标签,可以到proj.android/res/values目录下查找string.xml文件并修改。

    android:icon:程序图标,打开proj.android/res发现有三个drawable前缀的文件夹,drawable-hdpi、drawable-mdpi、drawable-ldpi,里面存放的图片分别对应高分辨率、中分辨率和低分辨率的图片。


    再看activity标签:

    android:name:activity的类名,必须指定。

    android:label:定义这个之后,就会覆盖application中的android:label。

    android:screenOrientation:屏幕放心,默认是横屏landscape,竖屏是portrait。


    Cocos2d-x 3.1 修改程序名、图标和屏幕方向

  • 相关阅读:
    selector 使用说明
    volley用法之 以post方式发送 json 参数
    linux系统下使用流行的版本管理工具 Git
    Android BLE 蓝牙编程(四)
    Android BLE 蓝牙编程(三)
    Android BLE 蓝牙编程(二)
    Android BLE 蓝牙编程(一)
    php比较两个字符串是否相同
    下拉刷新
    理财小工具(二)贷款计算器
  • 原文地址:https://www.cnblogs.com/Anzhongliu/p/6091909.html
Copyright © 2011-2022 走看看