android使用自定义标题时提示“you cannot combine custom titles with other ”
16lz
2021-12-04
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下修改SeekBar样式
- 日期选择控件
- Android拍照、录像、录音代码范例
- Android(安卓)Studio提升编译速度
- Android实用代码
- Android(安卓)默认声音大小修改
- Unity调用Android
- Android下修改SeekBar样式
- Android复制文件