本帖最后由 bigbillybear 于 2011-12-29 16:35:59 编辑

解决方案 »

  1.   

    没人帮看看吗??难道都会家过年了??把错误信息贴出来看看
    12-29 06:41:57.517: E/AndroidRuntime(614): FATAL EXCEPTION: main
    12-29 06:41:57.517: E/AndroidRuntime(614): java.lang.RuntimeException: Unable to start activity ComponentInfo{Rinder.ChangeTitle/Rinder.ChangeTitle.ChangeTitleActivity}: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
    12-29 06:41:57.517: E/AndroidRuntime(614):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at android.app.ActivityThread.access$600(ActivityThread.java:122)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at android.os.Handler.dispatchMessage(Handler.java:99)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at android.os.Looper.loop(Looper.java:137)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at android.app.ActivityThread.main(ActivityThread.java:4340)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at java.lang.reflect.Method.invokeNative(Native Method)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at java.lang.reflect.Method.invoke(Method.java:511)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at dalvik.system.NativeStart.main(Native Method)
    12-29 06:41:57.517: E/AndroidRuntime(614): Caused by: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
    12-29 06:41:57.517: E/AndroidRuntime(614):  at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:222)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2517)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2735)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:247)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at android.app.Activity.setContentView(Activity.java:1835)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at Rinder.ChangeTitle.ChangeTitleActivity.onCreate(ChangeTitleActivity.java:13)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at android.app.Activity.performCreate(Activity.java:4465)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
    12-29 06:41:57.517: E/AndroidRuntime(614):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
    12-29 06:41:57.517: E/AndroidRuntime(614):  ... 11 more
      

  2.   

    你这是 4.0吗 可能是布局文件的问题吗?<ImageView android:layout_width="wrap_content"   
            android:layout_height="wrap_content"   
            android:src="@drawable/ic_launcher"
            android:gravity="bottom"/>  
       <TextView android:id="@+id/text"   
            android:layout_width="wrap_content"   
            android:layout_height="wrap_content"   
            android:layout_alignParentLeft="true"   
            android:text="文本" />   
    TextView android:layout_alignParentLeft="true" 但是却是在ImageView 的右边 那ImageView 放到哪里?
      

  3.   

    我是用的4.0,我也怀疑是不是给用2.2因为例子都是2.2还没来得及试试
    按照网上的说法TextView android:layout_alignParentLeft="true" 效果应该是就在图标的右边排列,因为
    LinearLayout android:orientation="horizontal"而且就算title的布局去掉ImageView只保留一个TextView还是报错啊~~~~
      

  4.   

    You cannot combine custom titles with other title features字面意思应该就是你对一个titile设置了两个feature:
    一个是Window.FEATURE_CUSTOM_TITLE
    另一个呢?
      

  5.   

    You cannot combine custom titles with other title features
      

  6.   


    请问你说试了是把我的代码copy过去的吗??
    我直接把工程拿回家用也过不去去的说~~~
      

  7.   

    首先 你试试把第三句代码移到中间试试   其次 你可以试试this.requestWindowFeature(Window.FEATURE_NO_TITLE);  先写这句再写第一句  同时记得移动代码  有时候有些代码顺序是谷歌建议的   比如listview setfootview和setheadview建议放在setAdapter之前
      

  8.   


    一般说是在manifest里设置了Activity的theme属性可能造成这个问题教程的操作顺序,
      

  9.   


    终于知道问题在哪了。。是API版本的问题。。API11是个分水岭,这些代码在API11一下版本OK,我调的时候直接上4.0超了。现在用手机是2.2系统,API8就OK了。网上有两篇关于theme在不同API下效果的文章很有启发,有兴趣的可以搜搜
      

  10.   

      requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
          getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title);
            setContentView(R.layout.main);
      这样好像就可以了