Android 为什么可以';我不能使用ConstantLayout属性
所以我第一次尝试使用Android 为什么可以';我不能使用ConstantLayout属性,android,android-layout,android-constraintlayout,Android,Android Layout,Android Constraintlayout,所以我第一次尝试使用ConstraintLayout。我不能使用ConstraintLayout属性,例如app:layout\u constraintBottom\u toBottomOf来定位它的子项 当我尝试使用属性时,代码也不会编译。如果我使用ConstraintLayout但不使用它的属性,它将编译。我应该如何访问这些属性 我得到的构建错误是 error: not well-formed (invalid token). Message{kind=ERROR, text=error:
ConstraintLayout
。我不能使用ConstraintLayout属性,例如app:layout\u constraintBottom\u toBottomOf
来定位它的子项
当我尝试使用属性时,代码也不会编译。如果我使用ConstraintLayout
但不使用它的属性,它将编译。我应该如何访问这些属性
我得到的构建错误是
error: not well-formed (invalid token).
Message{kind=ERROR, text=error: not well-formed (invalid token)., sources=
[C:\AndroidWorkSource\SalesRabbit-Android\Universal-
Sales\app\src\main\res\layout\fragment_routeitem_list.xml:48], original
message=, tool name=Optional.of(AAPT)}
下面是讨论中的xml布局:
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/white">
. . . .
<android.support.v7.widget.RecyclerView
android:id="@+id/my_routs_list"
android:name="com.salesrabbit.android.sales.universal.canvass.routeing.MyRouteFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:layoutManager="LinearLayoutManager"
tools:context=".canvass.routeing.MyRouteFragment"
tools:listitem="@layout/fragment_routeitem"
android:layout_below="@id/my_routes_divider"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:layout_constraintBottom_toBottomOf ="id/my_routs_list"
android:gravity="center"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/buttonBarButtonStyle"
android:drawableLeft="@drawable/caret"
android:text="@string/my_routs_new_route"
android:background="@color/white"
android:layout_gravity="center_horizontal"
/>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
排队
app:layout_constraintBottom_toBottomOf ="id/my_routs_list"
在=
前面有一个奇怪的空白字符,名为头发空间(U+200A
),导致XML格式错误。在id之前删除它并添加一个@
,应该可以解决您的问题:
app:layout_constraintBottom_toBottomOf="@id/my_routs_list"
排队
app:layout_constraintBottom_toBottomOf ="id/my_routs_list"
在=
前面有一个奇怪的空白字符,名为头发空间(U+200A
),导致XML格式错误。在id之前删除它并添加一个@
,应该可以解决您的问题:
app:layout_constraintBottom_toBottomOf="@id/my_routs_list"
尝试编译后logcat返回什么?@jle错误:格式不正确(无效令牌)。消息{kind=ERROR,text=ERROR:格式不正确(无效令牌)。,sources=[C:\AndroidWorkSource\SalesRabbit Android\Universal Sales\app\src\main\res\layout\fragment\u routeitem\u list.xml:48],原始消息=,工具名=可选。of(AAPT)}哪一行是fragment_routeitem_list.xml中的第48行?尝试编译后logcat返回什么?@jle错误:格式不正确(无效令牌)。消息{kind=ERROR,text=ERROR:格式不正确(无效令牌)。,sources=[C:\AndroidWorkSource\SalesRabbit Android\Universal Sales\app\src\main\res\layout\fragment\u routeitem\u list.xml:48],原始消息=,工具名=可选。of(AAPT)}哪一行是fragment\u routeitem\u list.xml中的第48行?哇,我甚至不知道发际空间角色的存在。非常感谢你!哇,我甚至都不知道有发际角色存在。非常感谢你!