android使用自定义标题时提示“you cannot combine custom titles with other ”
16lz
2021-01-23
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.activity_main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_layout);
}
}
通过安卓自定义修改标题栏的时候,出现了一个问题“you cannot combine custom titles with other title features”
接着程序变崩了。
解决办法:在manifest文件中,修改android:theme="@style/android:Theme.Light"
这样便能正常运行了。
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.activity_main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_layout);
}
}
通过安卓自定义修改标题栏的时候,出现了一个问题“you cannot combine custom titles with other title features”
接着程序变崩了。
解决办法:在manifest文件中,修改android:theme="@style/android:Theme.Light"
这样便能正常运行了。
更多相关文章
- Android 程序打包及签名
- Android--用SAX解析xml文件
- android 调用系统安装程序
- Android复制文件
- 〖Android〗查找Android中的/system/lib中增加的lib文件是否在ap
- Android调用系统自带的文件管理器进行文件选择并获得路径
- Android 文件的选择
- android 程序日志记录
- android用于打开各种文件的intent