在包中发现属性“showAsAction”无资源标识符'机器人' [英] No resource identifier found for attribute 'showAsAction' in package 'android'

查看:168
本文介绍了在包中发现属性“showAsAction”无资源标识符'机器人'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为标题暗示,我得到这个错误在至少3个XML布局文件,但是,我没有看到任何这些XML文件的attritubeshowsAsAction,我错过了什么,或我只是盲目?,这里是XML文件中的问题:

 < XML版本=1.0编码=UTF-8&GT?;
< LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT
    机器人:方向=垂直>

    <按钮
        机器人:ID =@ + ID / findSelected
        机器人:layout_width =match_parent
        机器人:layout_height =WRAP_CONTENT
        机器人:文本=注册服务商ASISTENCIA
        机器人:的onClick =registrarAsistencia/>

     <的ListView
         机器人:ID =@ + ID / listaAlumnos
         机器人:layout_width =FILL_PARENT
         机器人:layout_height =FILL_PARENT/>

< / LinearLayout中>
 


 < LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    的xmlns:工具=htt​​p://schemas.android.com/tool​​s
    机器人:ID =@ + ID / LinearLayout1
    机器人:layout_width =match_parent
    机器人:layout_height =match_parent
    机器人:重力=中心|顶
    机器人:方向=垂直>

    <的TextView
        机器人:ID =@ + ID / lblCuenta
        机器人:layout_width =WRAP_CONTENT
        机器人:layout_height =WRAP_CONTENT
        机器人:文本=CUENTA
        机器人:textAppearance =:/>中的Andr​​oid ATTR / textAppearanceLarge?


    <的EditText
        机器人:ID =@ + ID / txtCuenta
        机器人:layout_width =WRAP_CONTENT
        机器人:layout_height =WRAP_CONTENT
        机器人:EMS =10/>

    <的TextView
        机器人:ID =@ + ID / lblPass
        机器人:layout_width =WRAP_CONTENT
        机器人:layout_height =WRAP_CONTENT
        机器人:文本=Contraseña
        机器人:textAppearance =:/>中的Andr​​oid ATTR / textAppearanceLarge?

    <的EditText
        机器人:ID =@ + ID / txtPass
        机器人:layout_width =WRAP_CONTENT
        机器人:layout_height =WRAP_CONTENT
        机器人:EMS =10
        机器人:inputType =textPassword/>

    <按钮
        机器人:ID =@ + ID / btnIniciarSesion
        机器人:layout_width =WRAP_CONTENT
        机器人:layout_height =WRAP_CONTENT
        机器人:的onClick =iniciarSesion
        机器人:文本=Iniciar使sesion/>

< / LinearLayout中>
 


 < RelativeLayout的的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    的xmlns:工具=htt​​p://schemas.android.com/tool​​s
    机器人:layout_width =match_parent
    机器人:layout_height =match_parent>


    <的TextView
        机器人:ID =@ + ID / textView1
        机器人:layout_width =WRAP_CONTENT
        机器人:layout_height =WRAP_CONTENT
        机器人:layout_alignParentLeft =真
        机器人:layout_alignParentTop =真
        机器人:文本=大文本
        机器人:textAppearance =:/>中的Andr​​oid ATTR / textAppearanceLarge?

< / RelativeLayout的>
 

另外,我使用的是Android 2.2(API 8)为目标的版本。我知道showAsAction在API 11实现的,但我只是无法在这里找到问题。

更新:的问题,面板显示以下错误:

  

错误产生最终的归档文件:java.io.FileNotFoundException:C:\用户\\的文档\的Andr​​oid \ Registro日ASISTENCIA \ BIN \ resources.ap_不存在

解决方案

你确定你正在寻找的* .xml文件吗?你似乎寻找在布局XMLSshowAsAction,但它的参数菜单。看起来相当变成... /菜单/ your_activity.xml

正在处理与利用的目标低于4.0和/或API小于14连接的问题。

因此​​,

一)修改这些参数,

b)由从不到ifRoom改变showAsAction的价值。

as the title suggest, I'm getting that error in at least 3 of the XML layout files, however, I dont see the attritube "showsAsAction" in any of those XML files, did I miss something or am I just blind?, here are the XML files in question:

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

    <Button
        android:id="@+id/findSelected"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Registrar Asistencia" 
        android:onClick="registrarAsistencia"/>

     <ListView 
         android:id="@+id/listaAlumnos" 
         android:layout_width="fill_parent"
         android:layout_height="fill_parent" />

</LinearLayout>


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/LinearLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center|top"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/lblCuenta"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Cuenta"
        android:textAppearance="?android:attr/textAppearanceLarge" />


    <EditText
        android:id="@+id/txtCuenta"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10" /> 

    <TextView
        android:id="@+id/lblPass"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Contraseña"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <EditText
        android:id="@+id/txtPass"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPassword" />

    <Button
        android:id="@+id/btnIniciarSesion"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="iniciarSesion"
        android:text="Iniciar Sesion" />

</LinearLayout>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >


    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:text="Large Text"
        android:textAppearance="?android:attr/textAppearanceLarge" />

</RelativeLayout>

Also, I'm using Android 2.2 (API 8) as the target version. I know "showAsAction" was implemented in API 11, but I just cant find the issue here.

Update: The problems panel shows the following errors:

Error generating final archive: java.io.FileNotFoundException: C:\Users\\Documents\Android\Registro de Asistencia\bin\resources.ap_ does not exist

解决方案

Are you sure you are looking in the right *.xml file? You seem to look for "showAsAction" in layout xmls, but it's parameter for the menu. Look rather into .../menu/your_activity.xml

The problem you are dealing with is connected with using target less than 4.0 and/or API less than 14.

So,

a) change those parameters,

b) change the value of showAsAction from "never" to "ifRoom".

这篇关于在包中发现属性“showAsAction”无资源标识符'机器人'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆