开发者

How to have a custom title bar and a TabWidget at the same time?

开发者 https://www.devze.com 2023-03-29 07:07 出处:网络
I have a program that is a TabWidget that calls different activities. The problem is it crashes when I call a class that already has its own custom title bar and gives me the error java.lang.RuntimeEx

I have a program that is a TabWidget that calls different activities. The problem is it crashes when I call a class that already has its own custom title bar and gives me the error java.lang.RuntimeException:

Unable to start activity ComponentInfo{com.cellphone/com.cellphone.Settings}: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features

How do you get around this problem? I want an android version of iPhone's menu bar (which is why I'm using the TabWidget) that also has its own custom title bar on every page.

EDIT: on my pages I'm using a custom title

    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);

    setContentView(R.layout.imtrackinglayout);

    this.getWindow().setFeatureInt(Window.FEATUR开发者_开发问答E_CUSTOM_TITLE,
        R.layout.custom_title_3);

My program crashes on the requestWindowFeature line with the above error.


Try deleting item name="android:windowNoTitle">true from theme.xml. That should fix your issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消