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.
onCreateView() is called by Android once the Fragment should inflate a view. onViewCreated() is called after onCreateView() and ensures that the fragment's root view is non-null .
view has a child class called View. Observe While the View group is the container that houses all of these views as well as many other ViewGroup such as linear or Frame Layout.
The general gist is this: If attachToRoot is set to true , then the layout file specified in the first parameter is inflated and attached to the ViewGroup specified in the second parameter. Then the method returns this combined View, with the ViewGroup as the root.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With