java 无法解析符号@dimen/activity_horizo​​ntal_margin

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/48002292/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 09:55:08  来源:igfitidea点击:

Cannot resolve symbol @dimen/activity_horizontal_margin

javaandroidandroid-layout

提问by lmathurin

Im following this tutorial on parsing JSON within Android

我正在关注有关在 Android 中解析 JSON 的本教程

https://www.tutorialspoint.com/android/android_json_parser.htm

https://www.tutorialspoint.com/android/android_json_parser.htm

when I copy and paste the data from list_item.xml I get "cannot resolve symbol" and google searches are yielding nothing

当我从 list_item.xml 复制并粘贴数据时,我得到“无法解析符号”并且谷歌搜索没有产生任何结果

回答by chandani c patel

Please add this line into your dimens.xml

请将此行添加到您的 dimens.xml

<dimen name="activity_horizontal_margin">16dp</dimen>

you can give whatever value you want instead of 16dp

你可以给任何你想要的值而不是 16dp

if you have not created dimens.xml, you can create it in values.xmlfolder.

如果你还没有创建dimens.xml,你可以在values.xml文件夹中创建它。