如何制作一个活动全屏幕?我的意思是没有通知栏。任何想法?
How do I make an activity full screen? I mean without the notification bar. Any ideas?
您可以做到这一点编程方式:
You can do it programatically:
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);
}
}
或者,你可以通过你的的AndroidManifest.xml
文件做到这一点:
<activity android:name=".ActivityName"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>