Android xml layout crashes after adding view

I hand-written a view and found that it crashed, but I had no problem copying someone else's code. I looked at it carefully for more than ten minutes and found that it was exactly the same, but when I wrote it myself, I got an error.
Later, I discovered that the first letter of the view was in uppercase, but I wrote it in lowercase (as would also provide a code reminder), and the result was a crash.
correct:

    <View
        android:layout_width="match_parent"
        android:layout_height="10px"
        android:background="#c4c4c4" />

Incorrect:

    <view
        android:layout_width="match_parent"
        android:layout_height="10px"
        android:background="#c4c4c4" />

Guess you like

Origin blog.csdn.net/qq_29391809/article/details/109897266