安卓xml布局加上view后闪退

自己手写了一个view发现闪退,但是抄别人代码里的却没问题,仔细看了十几分钟,一模一样的,但是自己写的就是会报错。
后来发现,view的首字母是大写的,而我写成了小写的(as还会代码提醒),结果闪退。
正确的:

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

错误的:

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

猜你喜欢

转载自blog.csdn.net/qq_29391809/article/details/109897266
今日推荐