Dean Clancy
Dean Clancy

Reputation: 517

Android Studio -Unable to inflate view tag without class attribute

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.

Upvotes: 15

Views: 18603

Answers (2)

mokheir
mokheir

Reputation: 1

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

You must use View Instead view.

Upvotes: -2

Umesh Singh Kushwaha
Umesh Singh Kushwaha

Reputation: 5741

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>

Upvotes: 57

Related Questions