问题
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