繁体   English   中英

Android:typeface错误:不允许输入类型。

[英]Android:typeface Error: types not allowed.

我正在创建样式xml文档,但遇到了问题。 我想使用droid serif字体,但是不能在模拟器中使用它,只能在Eclipse的预览屏幕中使用。 有时我可以写<Item name="android:typeface">2</item>而不会出现错误,但是当我尝试在Android仿真器中运行程序时,出现错误: error: Error: Integer types not allowed (at 'android:typeface' with value '2'). 当我按ctrl+space看到我可以写的内容时,它显示了serif (除其他外),但是当我写<Item name="android:typeface">serif</item>它说The word 'serif' is not correctly spelled.

这是.xml文件中的部分:

<style name="Header">
  <item name="android:layout_width">wrap_content</item>
  <item name="android:layout_height">wrap_content</item>
  <item name="android:textColor">#444444</item>
  <item name="android:paddingBottom">15dp</item>
  <item name="android:gravity">center</item>
  <item name="android:typeface">serif</item>
</style>

Eclipse具有XML字符串值的拼写检查器...通常,如果拼写检查器无法识别该单词,则会出现“拼写不正确”的情况。 如果确实是这样,它仍然应该可以编译和工作。 也许这就是这里发生的事情?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM