![](/img/trans.png)
[英]Error 'No resource identifier found' with Android sample project
[英]android RelativeLayout error “ 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"
/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.