2017-08-03 44 views
0

如何解决以下错误?不允许使用字符串类型 - axml Xamarin android

串类型不允许(在 'ID' 值为 '@ + ID /电话号码文本')

Main.axml

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 

android:orientation="vertical" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 
<TextView 
    android:text="Enter Phoneword" 
    android:textAppearance="?android:attr/textAppearanceLarge" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/textView1" /> 
<EditText 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:id=" @+id/PhoneNumberText" 
    android:text="1-855-XAMARIN" /> 
<Button 
    android:text="Translate" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/TranslateButton" /> 
<Button 
    android:text="Call" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/callbutton" /> 

回答

2

的ID为android:id=" @+id/PhoneNumberText"的声明在@+id/PhoneNumberText前有一个空格。

删除的空间,它应该工作:

android:id="@+id/PhoneNumberText"

相关问题