1、在AndroidManifest.xml设置主题

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

2、在layout添加一个文件title_layout.xml

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:id="@+id/topBg"    android:layout_width="fill_parent"    android:layout_height="wrap_content"    android:background="#fff" >    <TextView        android:id="@+id/textTile"        android:layout_width="fill_parent"        android:layout_height="40dp"        android:gravity="center|center_horizontal"        android:layout_gravity="center_horizontal"        android:text="@string/app_name" /></RelativeLayout>

3、在其他页面include引用title_layout.xml

        <!-- 顶部title -->        <include            android:id="@+id/title_layout"            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:layout_alignParentTop="true"            layout="@layout/title_layout" />        <!-- 顶部title -->

更多相关文章

  1. android删除sd卡文件
  2. Android实现文件夹目录选择器
  3. android之写文件到sd卡
  4. 使用Android内部的DownloadProvider下载文件,并获取cache权限
  5. 创建Android库的方法及Android .aar文件用法小结
  6. android的init.rc文件的语法
  7. android socket 配置文件
  8. Android学习笔记之mainfest文件中android属性
  9. android 下载文件注意事项

随机推荐

  1. java.net.UnknownServiceException: CLEA
  2. android 手机信息获得
  3. Android的string-array数据源简单使用
  4. Android(安卓)蓝牙耳机 语音输入与播放
  5. Android(安卓)Studio修改默认Activity继
  6. Android(安卓)网络链接状态 网络是否可用
  7. Android(安卓)SDK: sdkmanager 命令行工
  8. [Android]自定义弹幕View
  9. android TextView的字体颜色设置的多种方
  10. 【ALearning】第二章 Android工程相关知