`

You cannot combine custom titles with other title features

阅读更多
问题的原因是你为一个activity设置了两个title,,所以这个问题在tab中出现的频率较高。

一般可能是在具体的activity中设置cutsom title的属性,这样在tab中的activity(显示应用的名称的)和这个custom title(自定义的)就是两个了。

解决办法是在tab所在的activity中设置custom title.而不要再具体的activity中设置。

以下代码添加到主TabActivity中

@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	
	requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
	setContentView(R.layout.main);
         getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);
}
分享到:
评论
2 楼 aichixihongshi 2011-10-25  
zx13266879364 写道
你这是把整个应用的titlebar都改了,如果我只想改tab选项卡中的一项呢??怎么做!

本来就是改的整个应用的TitleBar,可以通过自己实现TabActivity
1 楼 zx13266879364 2011-10-24  
你这是把整个应用的titlebar都改了,如果我只想改tab选项卡中的一项呢??怎么做!

相关推荐

    Android 简化 自定义标题栏

    View headerBar = getLayoutInflater().inflate(R.layout.header_bar, findViewById(R.id.custom_toolbar)); // 加载自定义标题栏布局 ((ViewGroup)findViewById(R.id.container)).addView(headerBar); // 将标题...

    最新ray Combine: Asynchronous Programming with Swift5.1.pdf

    Combine uses a multitude of advanced Swift features such as generics, so you should have at least an intermediate-level knowledge of Swift. If you want to try things out on a physical iOS device, ...

    Combine Asynchronous Programming with Swift.zip

    The introduction of Combine into the Swift ecosystem now gives you a native way to manage asynchronous events in Swift, meaning you don’t have to rely on third-party reactive frameworks for event-...

    Combine Asynchronous Programming with Swift v0.3.0.zip

    《Combine: Asynchronous Programming with Swift》是针对Swift编程语言中的一种重要特性——Combine框架的详细指南。这本书结合了epub、pdf两种格式的电子书以及源代码,版本为V0.3.0,旨在帮助开发者深入理解并...

    Android代码-CustomActivityOnCrash

    Custom Activity On Crash library ...Of course, you can combine this library with any other crash handler such as Crashlytics, ACRA or Firebase, just set them up as you would normally. Try it Forc

    Combine Asynchronous Programming with Swift (Combine异步编程指南): PDF+EPUB+源码

    使用Combine框架,用Swift掌握声明式异步编程! 编写异步代码可能具有挑战性,它具有各种可能的接口来表示,执行和使用异步工作-委托,通知中心,KVO,闭包等。杂乱地对待所有这些不同的机制可能会有些不知所措。真...

    Mesh Combine Studio 1.16.unitypackage

    Instead of manually combining meshes, which is very tedious, MCS will do this automatically for you and the performance improvements it gives cannot be achieved with manual combining. Just simple drag...

    Beginning iPhone Development with Swift 3.epub

    As you work your way through this book, you will create a number of small applications, each designed to highlight specific iOS features and to show you how to control or interact with those features....

    高清彩版 Combine_Asynchronous_Programming_with_Swift_5.1_v1.0.0.pdf

    根据提供的文件信息,我们可以推断出这是一本关于如何在iOS开发中利用Swift 5.1结合Combine框架进行异步编程的专业书籍。本书由Scott Gardner、Shai Mishali、Florent Pillet和Marin Todorov共同编写,并版权所有于...

    Learning.Web.Development.with.Bootstrap.and.Angular.2nd.Edition.epub

    Once you're done with this book, you'll not only have a lovely little project management application app running, but you'll also take with you the confidence to innovate and build your own ...

    SwiftUI 与 Combine编程

    SwiftUI和Combine是Apple在iOS、macOS、watchOS和tvOS等平台上推出的两种关键的开发框架,它们极大地简化了用户界面(UI)的设计和事件处理。SwiftUI提供了声明式编程方式来构建用户界面,而Combine则是一个强大的...

    SwiftUI 与 Combine 编程

    SwiftUI 与 Combine 编程

    Object Oriented Programming with Swift 2

    You will learn to protect and hide data with the data encapsulation features of Swift. Then, you will explore how to maximize code reuse by writing code capable of working with objects of different ...

    Getting to Know Vue.js Learn to Build Single Page

    With Getting to Know Vue.js, you’ll see how to combine reusable code with custom components, allowing you to create snippets of reusable code to suit your specific business needs. You’ll also ...

    Getting to Know Vue js

    With Getting to Know Vue.js, you’ll see how to combine reusable code with custom components, allowing you to create snippets of reusable code to suit your specific business needs. You’ll also ...

    Machine Learning for OpenCV_Intelligent image processing with Python(2017).epub

    Chapter 1, A Taste of Machine Learning, will gently introduce you to the different subfields of machine learning, and explain how to install OpenCV and other essential tools in the Python Anaconda ...

    Geospatial.Development.By.Example.with.Python

    Much more than simple scripts, you will write functions to import data, create Python classes that represent your features, and learn how to combine and filter them. With pluggable mechanisms, you ...

Global site tag (gtag.js) - Google Analytics