android&cocos程序名,图标以及屏幕方向

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

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

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 3       package="com.pianotiles.org"
 4       android:versionCode="1"
 5       android:versionName="1.0">
 6 
 7     <uses-sdk android:minSdkVersion="9"/>
 8     <uses-feature android:glEsVersion="0x00020000" />
 9 
10     <application android:label="@string/app_name" 
11                  android:icon="@drawable/icon">         
12                      
13         <!-- Tell Cocos2dxActivity the name of our .so -->
14         <meta-data android:name="android.app.lib_name"
15                   android:value="cocos2dcpp" />
16 
17         <activity android:name="org.cocos2dx.cpp.AppActivity"
18                   android:label="@string/app_name"
19                   android:screenOrientation="portrait"
20                   android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
21                   android:configChanges="orientation">
22 
23             <intent-filter>
24                 <action android:name="android.intent.action.MAIN" />
25                 <category android:name="android.intent.category.LAUNCHER" />
26             </intent-filter>
27         </activity>
28     </application>
29 
30     <supports-screens android:anyDensity="true"
31                       android:smallScreens="true"
32                       android:normalScreens="true"
33                       android:largeScreens="true"
34                       android:xlargeScreens="true"/>
35 
36     <uses-permission android:name="android.permission.INTERNET"/>
37 </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。

 

转载于:https://www.cnblogs.com/ly2717/p/6109126.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值