Android基础:去掉app界面的标题-Title
16lz
2021-01-23
去掉app的标题
方法一:
当继承自Activity
或ActionBarActivity
时,在setContentView(...)
方法前调用
requestWindowFeature(Window.FEATURE_NO_TITLE);
当继承自AppCompatActivity
时,就无效了,必须采用方法五。
方法二:在activity节点下设置
theme:android:theme=”@android:style/Theme.Black.NoTitleBar” 黑色背景
android:theme=”@android:style/Theme.Light.NoTitleBar” 白色背景
“android:Theme.Holo.Light.NoActionBar”白底(包含alertDialog)
方法三:所有的value目录下的style文件修改为(不加@也可以)
style name=”AppBaseTheme” parent=”@android:style/Theme.Light.NoTitleBar”
方法四:application节点下的theme替换为:
android:theme=”@android:style/Theme.Black.NoTitleBar”
android:theme=”@android:style/Theme.Light.NoTitleBar”
android:theme=”@android:style/Theme.NoTitleBar”
方法四:
<style name="AppTheme" parent="AppBaseTheme"> -- All customizations that are NOT specific to a particular API-level can go here. --> <item name="android:windowNoTitle">trueitem>style>
方法五:
//隐藏标题栏ActionBar actionBar = getSupportActionBar();//ActionBar actionBar = getActionBar();actionBar.hide();
更多相关文章
- Android Studio 中方法数65536 或超过64K的解决方案
- Android SDK使用迅雷下载方法
- Android应用程序启动时发生AndroidRuntime : ClassNotFoundExcep
- Android的Activity的launchMode与onActivityResult方法的关系
- Android DrawerLayout和NavigationView 的使用方法
- Android编译本地C++程序方法
- Android开发者网站打不开的解决方法
- android sdk manager 无法更新解决方法
- Delphi XE5 for android 使用 BITMAP STYLE DESIGNER 改变控件背