【问题标题】:Multiple annotations found at this line: - error: No resource identifier found for attribute 'layout_alignBaseLine' in package 'android'在此行找到多个注释:-错误:在包 'android' 中找不到属性 'layout_alignBaseLine' 的资源标识符
【发布时间】:2016-03-15 18:55:24
【问题描述】:

这是我的 .xml 代码,上面写着“在这一行找到多个注释: - 错误:在包'android'中找不到属性'layout_alignBaseLine'的资源标识符。我不知道为什么会出现这个问题。有人帮助我。

<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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.relativelayout.MainActivity" >

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBaseLine="@+id/button1"
    />

<EditText
    android:id="@+id/editText1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignBaseLine="@+id/button1"
    android:layout_toLeftOf="@+id/textView1"
    android:layout_toStartOf="@+id/texView1"
    android:layout_toRightOf="@+id/button1"
    android:layout_toEndOf="@+id/button1"
    />

<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"      
    android:text="Button"
    android:layout_alignParentRight="true" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentEnd="true"/>

 </RelativeLayout>

My Screen

【问题讨论】:

  • 您需要哪种类型的布局?在此处发布屏幕截图或草图。
  • 您的 xml 文件的名称是什么?你是在 xml 或 java 类文件中得到那个错误吗?
  • @sud 它是“activity_main.xml”。尝试运行整个代码时出现错误。
  • 在您的代码中某处使用过layout_alignBaseLine?如果没有,请发布您的代码
  • @sud 只有这个 .xml 先生 :) 我使用 layout_alignbaseline

标签: android xml eclipse


【解决方案1】:

应该有layout_alignBaseline 而不是layout_alignBaseLine 第二个l 字母应该是小写

【讨论】:

  • 先生。我尝试将其更改为小写。但它说“你的代码有错误”。我的 .xml 中只有警告标志,请参阅我添加的屏幕截图。
猜你喜欢
  • 1970-01-01
  • 2013-12-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多