我为这个问题而疯狂...我想做这样的事情:
这是我在xml布局文件中的SIMPLY代码:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:p1="http://schemas.android.com/apk/res/android"
p1:minWidth="25px"
p1:minHeight="25px"
p1:layout_width="match_parent"
p1:layout_height="match_parent"
p1:id="@+id/relativeLayout1">
<WebView
p1:layout_width="match_parent"
p1:layout_height="wrap_content"
p1:id="@+id/webView1"
p1:layout_alignParentTop="true"
p1:layout_above="@id/textView1" />
<TextView
p1:text="Medium Text"
p1:textAppearance="?android:attr/textAppearanceMedium"
p1:layout_width="match_parent"
p1:layout_height="wrap_content"
p1:id="@+id/textView1"
p1:layout_alignParentBottom="true" />
</RelativeLayout>
但是我收到的错误是这样的:
错误:找不到与给定名称匹配的资源(在“ layout_above”处,值为“ @ id / textView1”)。
这对我来说很奇怪。。。因为我指定了textView1 !!!!
有主意吗?!?
该TextView
id为textView1
之后的分析WebView
所引用它。使用@id/*
语法指定解析器正在解析现有ID。在这种情况下,由于您TextView
尚未解析,因此它将失败。
layout_above=@+id/textView1
而是使用它来预先声明您的TextView的ID。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句