Android Studio -Unable to inflate view tag without class attribute

纵然是瞬间 提交于 2019-12-21 03:49:10

问题


When I enter a view tag into my xml code I get a Rendering Problem that says: "Unable to inflate view tag without class attribute". How can I fix this ?

    <view
        android:layout_width="1dp"
        android:layout_height="match_parent"
        android:background="@android:color/darker_gray">
    </view>

When I remove this code it renders fine.


回答1:


As mentioned in comment by Blackbelt, update view to View:

<View
    android:layout_width="1dp"
    android:layout_height="match_parent"
    android:background="@android:color/darker_gray">
</View>



回答2:


<View
    android:layout_width="1dp"
    android:layout_height="match_parent"
    android:background="@android:color/darker_gray">
</View>

You must use View Instead view.



来源:https://stackoverflow.com/questions/40047133/android-studio-unable-to-inflate-view-tag-without-class-attribute

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!