Android 标题
2016-02-22 10:48
405 查看
public void setTitle(CharSequence title) //改变标题内容 setTitle("标题内容"); requestWindowFeature(Window.FEATURE_NO_TITLE); //隐藏标题
/* 隐藏标题和最上面的电池电量及信号栏(全屏) */ public void setFullScreen(){ requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FALG_FULLSCREEN,WindowManager.LayoutParams.FALG_FULLSCREEN); }
//自定义标题内容 manifest中
<activity android:name=".MainActivity" android:screenOrientation="portrait" android:label="@string/titlebar_text"> </activity>
//自定义标题布局
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); //预先设置允许改变的窗口状态,需在setCOntentView之前调用,否则设置标题时抛出运行时异常 requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.custom_title); //标题区域可设置为layout,如此可以有丰富的展现方式 getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.custom_title_1); //R.layout.layout_custom_title_1 是自定义标题布局 }
相关文章推荐
- android刷新媒体库
- Android开发-优秀博客参考
- android中延迟执行某个任务
- Android性能优化典范
- Ubuntu android studio 创建虚拟设备问题
- Android ActionBar 创建 及动态改变
- Android中View的性命周期
- Android中用OpenGL ES Tracer分析绘制过程
- adnroid开发常用的难点记录(如 屏幕录制)
- 如何获取Android5.1 Source Code
- 瀑布流效果RecycleView+CardView
- Android模仿知乎的回答详情页的动画效果
- 【Android】ExpandableListView 默认展开和不可点击
- [Exception Android 22] - Could not find com.android.support:design:23.1.1
- Android Low Memory Killer
- Android UI效果之绘图篇(一)
- Android软件开发之获取通讯录联系人信息 + android联系人信息的存储结构 + Android联系人读取操作笔记
- android decorView详解
- android decorView详解
- android decorView详解