2013-09-10 72 views
2

我嘗試使用AndEngine進行例如遊戲,採用簡單的代碼:AndEngine:如何刪除啓動默認的活動畫面

public class MainActivity extends SimpleBaseGameActivity { 

    static final int CAMERA_WIDTH = 800; 
    static final int CAMERA_HEIGHT = 480; 

    @Override 
    public EngineOptions onCreateEngineOptions() { 
     Camera camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT); 
     return new EngineOptions(true, ScreenOrientation.LANDSCAPE_SENSOR, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), camera); 
    } 

    @Override 
    protected void onCreateResources() { 
     //TODO 
    } 

    @Override 
    protected Scene onCreateScene() { 
     Scene scene = new Scene(); 
     scene.setBackground(new Background(0.09804f, 0.6274f, 0)); 
     return scene; 
    } 
} 

,但我發現了一個奇怪的現象:當應用程序啓動時,在第一瞬間就說明像標題欄和黑暗背景的默認Android活動屏幕,只是一會兒,然後開始我的活動與綠色背景,因爲它必須是。我怎樣才能刪除這個啓動的東西?

回答

1

看看你的AndroidManifest.xml文件。

在應用: 刪除機器人:主題= 「@風格/ AppTheme」

在活動: 添加機器人:screenOrientation = 「風景」 或添加機器人:screenOrientation = 「肖像」

0

我問題是,我不得不

screenOrientation =景觀|傳感器,

使它:

screenOrientation = landscape,

並且默認的應用程序屏幕消失。