Cri*_*ian 120

你可以以编程方式执行:

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

public class ActivityName extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // remove title
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.main);
    }
}
Run Code Online (Sandbox Code Playgroud)

或者您可以通过您的AndroidManifest.xml文件来完成:

<activity android:name=".ActivityName"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
</activity>
Run Code Online (Sandbox Code Playgroud)

编辑:我添加了一些行,以便您可以全屏显示,因为它似乎是你想要的.


Vit*_*y A 55

使用

<activity android:name=".ActivityName" 
          android:theme="@android:style/Theme.NoTitleBar">
Run Code Online (Sandbox Code Playgroud)


cha*_*aon 18

您可以以编程方式执行此操作:或者不使用操作栏

//It's enough to remove the line
     requestWindowFeature(Window.FEATURE_NO_TITLE);

//But if you want to display  full screen (without action bar) write too

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

     setContentView(R.layout.your_activity);
Run Code Online (Sandbox Code Playgroud)