requestWindowFeature(Window.FEATURE_NO_TITLE);   这个方式在手机上好用,在平板上不好用!

解决方案 »

  1.   

    这不是原因,你用的是 android supportv7 包里的 Appcompat 框架,来实现 Actionbar 对吧,对于这个包里的 ActionbarActivity, 他在初始化的时候,会检查你的 theme, 如果主题不是 Appcompat 的主题就会报错,你改一下主题形式,让他为,Theme.AppCompat.Light 就好了
      

  2.   

    我是在手机上用,SDK 的版本是:10,Android 的版本是:2.3.6(不知道说的对不对)
      

  3.   

    在 Eclipse 的 Activity 的 “Graphic Layout” 中看到的已经是没有标题栏了,可能下载到手机上运行却有标题栏。
      

  4.   

    如果要隐藏掉 Actionbar, 就是用 getSupportActionbar().hide()就好了
      

  5.   


    是这样修改吗?
    <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/Theme.AppCompat.Light">
      

  6.   

    恩,如果你的 activity 没有重写 android:theme 的话,这样就好了
      

  7.   


    Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
      

  8.   


    嗯,我没有重写 Activity。但那样设置还是没有达到隐藏标题栏的目的。
    不过调用你 6L 提供的方法是可以的。
    多谢!
      

  9.   

    感觉还是没有找到Theme.NoTitleBar,既然V7包,看下V7包里面的style有什么