unexpected namespace prefix "android" found for tag TextView
根佈局元素缺少 Android 命名空間聲明,導致所有 android:xxx 屬性無法解析。
在根元素(如 LinearLayout、RelativeLayout)添加:
<LinearLayout
xmlns:android="https://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- 子視圖 -->
</LinearLayout>
xmlns:android。<include>、<merge> 等特殊標籤同理。補全命名空間後,布局編輯器預覽與編譯均恢復正常。