首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >字符串资源和属性规范错误

字符串资源和属性规范错误
EN

Stack Overflow用户
提问于 2013-10-01 18:47:54
回答 4查看 79关注 0票数 0

我刚开始学习Java编程和Eclipse。我似乎无法摆脱这些错误,有人知道如何修复它吗?

我在关注"thenewboston“项目。

我打印了一张图片,这样你就可以看到是什么在困扰着我:http://www.ladda-upp.se/bilder/bwqzgrwlvjqusf/

代码语言:javascript
运行
复制
<TextView
    android:id="@+id/textView1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:gravity="center"
    android:textSize="45sp" 
    />  




<Button
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textView1"
    android:layout_centerHorizontal="true"
    android:text="Add one"
    "android:id="@+id/bAdd"
     />

<Button
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textView1"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="50dp"
    android:text="Subtract one"
    android:textSeize="20sp" 
    android:id="@+id/bSub"/>

EN

回答 4

Stack Overflow用户

发布于 2013-10-01 18:52:43

android:id="@+id/bAdd"替换"android:id="@+id/bAdd"

票数 0
EN

Stack Overflow用户

发布于 2013-10-01 18:52:45

变化

代码语言:javascript
运行
复制
<Button
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textView1"
    android:layout_centerHorizontal="true"
    android:text="Add one"
    "android:id="@+id/bAdd"
     />

代码语言:javascript
运行
复制
<Button
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textView1"
    android:layout_centerHorizontal="true"
    android:text="Add one"
    android:id="@+id/bAdd"
     />
票数 0
EN

Stack Overflow用户

发布于 2013-10-01 18:53:04

有一个语法错误:

代码语言:javascript
运行
复制
"android:id="@+id/bAdd"

应从属性名称中删除"

代码语言:javascript
运行
复制
android:id="@+id/bAdd"

然后在

代码语言:javascript
运行
复制
android:textSeize="20sp" 

属性名称应为textSize

剩下的问题是关于硬编码UI字符串的lint警告。在此学习阶段,您可以忽略这些问题。(请参阅稍后的http://developer.android.com/guide/topics/resources/localization.html。)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19114234

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档