android4.0自定义标题报错 -----断点记录
16lz
2021-01-23
阅读更多
1:AndraoidMainfest中 activity的样式设置 android:theme="@android:style/Theme.NoTitleBar"
2:代码部分
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); //会与 android:theme="@android:style/Theme.NoTitleBar"冲突,只能存在一个
setContentView(R.layout.activity_dataentering);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
R.layout.top_title);
解决办法:
1:androidMainfest中activity的样式设置为 android:theme="@style/android:Theme.Light"
2:代码
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.activity_dataentering);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
R.layout.top_title);
更多相关文章
- [置顶] Android 代码混淆 选项说明
- android秒表计时代码
- android代码片段一
- android studio gradle编译时的jar冲突错误
- Android Build 异常 -android.support.VERSION 冲突
- Android Camera子系统代码流程1
- Activity 模版样式简介
- APIDEMO 字体默认样式
- 【Demo实例】Android FTP上传带进度条(优化后代码)