ITeye博客

android4.0自定义标题报错 -----断点记录

zengyan2012 · 2013-01-30 15:05 · android · 移动开发 · Markdown

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);

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。