- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
更新:已解决,我是白痴,谢谢大家!
Okay little bit weird.. I just created a layout file for list items, I can see it there now, in my res/layout folder. It's called itemListBudget.xml. Inside i've declare two id's, catItem and budgetAmount as you can see here: http://pastebin.com/ZV0wr9L0 (it'll only take a second to look at)
So now i'm just trying to bind data from my sqlite table to my list! Here's my method:
//
private static int[] TO = { R.id.catItem, R.id.budgetAmount, };
private void showBudgetOutcome(Cursor cursor) {
//Set up data binding
SimpleCursorAdapter adapter = new SimpleCursorAdapter(
this, R.layout.itemListBudget, cursor, FROM, TO,);
setListAdapter(adapter);
}
Now i'm being told that R.id.catItem cannot be resolved. R.id.budgetAmount cannot be resolved and of course R.layout.itemListBudget cannot be resolved. Why on earth could this be?
I also have an error message saying my setListAdapter(adapter) is undefined, but i think that's caused by the problem above right?
最佳答案
如果在 Eclipse 中尝试对项目进行清理并强制其重建 R.java
您的布局文件名中不能有大写字母!!!它的 [a-z0-9_.]
关于android - 神秘!我的一个 .xml 布局资源未被检测到!这是怎么回事?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4319263/
我是一名优秀的程序员,十分优秀!