所以我正在学习如何制作TicTacToeGame的教程。 我收到的错误与此相同:No resource found that matches the given name (at 'title' with value '@string/action_settings') 所以我在我的代码中添加了这一行:
<string name="action_settings">Settings</string>
现在我收到了这个新错误:``令牌上的语法错误&#34;标题&#34;,删除此令牌&#39;&#39;。
错误在课堂上:R.java&gt; R>字符串。
这一行:
public static final class string {
public static final int =0x7f0a0028; \\red mark @ int
我认为错误是因为我“设置&#39;&#39;不是我应该使用的词,但我不能放弃。
这是我的main.xml:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.tictactoetest.MainActivity" >
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never"/>
</menu>
这是我的strings.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">testjk</string>
<string name="hello_world">Hello world!</string>
<string name="turn_human">Your turn.</string><string name="first_human">You go first.</string>
<string name="turn_computer">Android\'s turn</string>
<string name="result_tie">It\'s a tie!</string>
<string name="result_human_wins">You won!</string>
<string name="result_android_wins">You lose!</string>
<string name="one">1</string>
<string name="two">2</string>
<string name="three">3</string>
<string name="four">4</string>
<string name="five">5</string>
<string name="six">6</string>
<string name="seven">7</string>
<string name="eight">8</string>
<string name="nine">9</string>
<string name="info">Info</string>
<string name="human">Human: </string>
<string name="ties">Ties: </string>
<string name="android">Android: </string>
<string name="contact_heading">Contact Info</string>
<string name="action_settings">Settings</string>
<string name="contact_info">
<b>Name:</b> hiii
<b>Achternaam</b> hello
<b>Email</b> test@haha.com
</string>
<string name="about heading"> About </string>
<string name="">This app allowed you to play a game tic tac toe
blablalbalbalblalbalblalbalblablalblablalblalbla</string>
</resources>
答案 0 :(得分:0)
public static final int =0x7f0a0028; \\red mark @ int
这里没有名字
EG:
public static final int ticTacBlahBlah = 0x7f0a0028;
因为
<string name="">This app allowed you to play a game tic tac toe
blablalbalbalblalbalblalbalblablalblablalblalbla</string>
输入一个名字,事情应该有效。
<string name="ticTacBlahBlah">This app allowed you to play a game tic tac toe
blablalbalbalblalbalblalbalblablalblablalblalbla</string>