代码运行时没有错误,但设计器给我错误并且不会出现
Cycle found (count=51) evaluating 'activity_nearby_places' with pathString="file:///c:/ path="C:\New folder (148)\GaspriceinEgypt\app\src\main\res\layout\activity_nearby_places.xml" stratIndex=3 suffixEndIndex=3 separator='\\"(parserfile=file:\\\\ C:\New folder (148)\GaspriceinEgypt\app\src\main\res\layout\activity_nearby_places.xml)
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".NearbyPlaces"
tools:layout="@layout/activity_nearby_places" />
1条答案
按热度按时间kgsdhlau1#
您似乎创建了一个重复循环。
tools:layout
不应该引用您所在的文件,而是您希望设计器显示的某个示例布局文件。来自文档:
This attribute declares which layout you want the layout preview to draw inside the fragment (because the layout preview cannot execute the activity code that normally applies the layout).
请尝试删除
tools:layout=
行,或在其中放入更合适的内容。https://developer.android.com/studio/write/tool-attributes#toolslayout