您的位置:首页 > 移动开发

Android Application - No window title, Full screen, Landscape (横向显示)

2010-10-22 17:08 369 查看
1. 横向显示

android:screenOrientation="landscape" in AndroidManifest.xml

2. Set "No-Title": To add winStyle.xml in res/values

(代码编辑器有问题,改成图片插入)



android:them="@style/NoTitle" in AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sdt.mycheckbox"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".MyCheckBox"
android:label="@string/app_name"
android:screenOrientation = "landscape"
android:theme="@style/NoTitle">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>


3. Full Screen

Add below line in java file:

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

java file:

package com.sdt.mycheckbox;
import android.app.Activity;
import android.os.Bundle;
import android.view.WindowManager;
public class MyCheckBox extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

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

}
}


Screenshot:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐