제목이 말했듯이, 나는 내 프로젝트 activity_maps 에서 하나의 xml 파일 만 사용 하고 있었고 모든 것이 잘 작동했지만 info_window.xml 을 추가 한 후 기호 R이 빨간색이되었고 이유를 모르겠습니다. 프로젝트를 재 구축하려고했지만 아무 일도 일어나지 않았습니다. .
이것은 내 activity_maps.xml입니다 .
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MapActivity" >
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"/>
</RelativeLayout>
이것은 내 info_window.xml입니다 .
<?xml version="1.0" encoding="utf-8"?>
<linearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageview1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/sefleticon"/>
<linearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@id/tv_place"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:id="@id/tv_men"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@id/tv_women"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@id/tv_like"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</linearLayout>
</linearLayout>
두 XML 파일 모두 res / layout에 있습니다.
두 번째 XML에서 :
linearLayout 을 LinearLayout으로 변경
그리고 TextView에서 android : id = "@ id / your_id" 를 android : id = "@ + id / your_id"로 변경합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다