android 4.1中的数字时钟?

时间:2012-08-18 12:34:34

标签: android

我无法在Android 4.1中拖放数字时钟,但令人惊讶的是能够拖拽和放大掉模拟时钟!

错误消息:

  

找不到以下类:    - DigitalClock(更改为android.widget.DigitalClock,修复构建路径,编辑XML)

enter image description here

2 个答案:

答案 0 :(得分:0)

我希望您不要错过XML代码中的任何一行。

<?xml version="1.0" encoding="UTF-8"?> <!-- at the very beginning of your XML code -->


<root xmlns:android="http://schemas.android.com/apk/res/android" ... > <!-- inside the first element (e.g. rootor anything else) in your XML layout code -->

答案 1 :(得分:0)

当我拖放数字时钟时,我在Eclipse IDE中收到了同样的错误,但在运行它时没有问题,时钟出现正确。似乎错误只是虚假的,可以忽略。

需要注意的另一件事是Digital Clock has been deprecated as of API level 17,如果您能够定位API级别17或更高版本,则Text Clock是要使用的小部件。当拖入时,我没有收到任何错误。