android studio를 배우기 시작했습니다. 상대방 레이아웃과 XML 파일 오류가 발생했습니다 또한 오류나 일으키는 몇 가지 누락/삭제 된 XML 콘텐츠가 있습니다. 제발 좀 도와주세요. 현재 activity_main.xml 코드는 다음과 같다 : 렌더링 문제xml 파일에서 XML을 파싱하는 중 오류가 발생했습니다. android studio에서 형식이 올바르지 않습니다 (토큰이 유효하지 않습니다)
참고 :
This project contains Java compilation errors, which can cause rendering failures for custom views. Fix compilation problems first.
참고 :
One or more layouts are missing the layout_width or layout_height attributes. These are required in most layouts.<br/
<android.support.design.widget.AppBarLayout> does not set the required layout_width attribute: Set to wrap_content, Set to match_parent<br />
<android.support.design.widget.AppBarLayout> does not set the required layout_height attribute: Set to wrap_content, Set to match_parent<br />
<android.support.v7.widget.Toolbar> does not set the required layout_width attribute: Set to wrap_content, Set to match_parent<br/
<android.support.v7.widget.Toolbar> does not set the required layout_height attribute: Set to wrap_content, Set to match_parent<br/
<android.support.design.widget.FloatingActionButton> does not set the required layout_width attribute: Set to wrap_content, Set to match_parent <br />
<android.support.design.widget.FloatingActionButton> does not set the required layout_height attribute: Set to wrap_content, Set to match_parent <br />
Or: Automatically add all missing attributes
<?xml version="1.0" encoding="utf-8"?>
android:fitsSystemWindows="true"
tools:context="com.mindbuzz.big.calculator.MainActivity"> <android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#ed0d0d"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_gravity="bottom|end"`enter code here`
android:layout_margin="@dimen/fab_margin "
app:srcCompat="@android:drawable/ic_dialog_email"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<include layout="@layout/content_main"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignBottom="@+id/appBarLayout"
android:layout_below="@+id/appBarLayout" />
</ android:layout_width="wrap_content"
android:layout_height="wrap_content"> </android.support.design.widget.CoordinatorLayout>
것이죠 미리보기에서 렌더링 오류입니다
Gradle 빌드에서 다음과 같은 오류가 표시됩니다 :
Error:(3) Error parsing XML: not well-formed (invalid token)
Error:(3) Error parsing XML: not well-formed (invalid token)
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
감사합니다.
왜이 ' android : layout_width = "wrap_content" android : layout_height = "wrap_content">'? – codeMagic
@codeMagic 내가 언급 한 바로는 현재 레이아웃의 모든 내용을 묶기 위해 그것을 설명하는 데 사용되었습니다. – BHASKAR
@BHASKAR, 죄송 합니다만, 그 의견은 문법적이거나 이해할 수있는 영어가 아닙니다. –