Android新手入门教程(三):理解Activityの隐藏标题栏
如果愿意的话,我们可以把Activity的标题栏给隐藏了。如果想这么干的话,只需使用requestWindowFeature()方法,并传递Window.FEATURE_NO_TITLE常量值。
[java]
package net.learn2develop.Activity101;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
public class Activity101Activity extends Activity {
String tag = "Lifecycle";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// ---hides the title bar---
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
Log.d(tag, "In the onCreate() event");
}
}
package net.learn2develop.Activity101;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
public class Activity101Activity extends Activity {
String tag = "Lifecycle";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// ---hides the title bar---
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
Log.d(tag, "In the onCreate() event");
}
}
效果图:
摘自 horsttnann
补充:移动开发 , Android ,