首页 > 移动平台 > 详细

Android中editText使用报错

时间:2016-11-23 07:11:06      阅读:246      评论:0      收藏:0      [点我收藏+]

在activity_main.xml文件中添加了editText控件

 <EditText
        android:id="@+id/edit_text"
        android:hint="@the next"   

  <!--用the next或者@the next都报错,要使用@string/the next,用标准写法在string.xml文件中配置键值对(name:the next   vlaue:下一步),注意键值对有未使用的也会报错-->
        android:inputType="text"
        android:text="@string/string1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/textView"
        android:layout_below="@+id/textView"
        android:layout_marginTop="36dp"
        android:ems="10" /> 

提示error: Error: No resource type specified (at ‘hint‘ with value ‘@string‘)

以及Hardcoded string "the next", should use @string resource

error: No resource identifier found for attribute ‘backIcon’ in package三个错误

第三个错误属于自定义控件的命名空间问题,我贴出个链接自己去看http://blog.sina.com.cn/s/blog_6aefcbed01013rpc.html  

当然我这之所以报错纯属我把inputType拼错了

 

Android中editText使用报错

原文:http://www.cnblogs.com/DZayxj520/p/6092142.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!