安卓相对布局错误" No resource identifier found...."



我正在尝试在Android中编写我的第一个相对布局。

我有一个工作正常的线性布局,所以我的相对布局 xml 文件基于它。

我收到以下错误:

    error: No resource identifier found for attribute 'layout_bottom' in package 'android'

xml(部分)代码为:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <TextView
    android:id="@+id/text_1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="--"
    android:layout_alignParentTop="true"
    /> 
    <RadioGroup                                <-- the error is given in this line
          android:id="@+id/kk"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:layout_bottom="@id/text_1"
          >

谢谢

这不是layout_bottom,而是layout_alignBottom

http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html

按如下方式进行更改:

   <RadioGroup
          android:id="@+id/kk"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:layout_below="@id/text_1"
       />

相关内容

最新更新