安卓错误解决

    今天在学的时候,遇到好多error, 红色的让人看着就烦、、、

    1、 You must call removeView() on the child's parent first

    我是因为添加了重复的view,删掉就解决了,还有其他的不错的解决方法案例 点我

    

    2、error: No resource identifier found for attribute ‘**’ in package

    检查一下自己的包,里面是否有还没定义的,引用包的两种方法

xmlns:custom="http://schemas.android.com/apk/res-auto"

xmlns:custom="http://schemas.android.com/apk/com.example.st.mytopbar"


 3、R.styleable 无法找到,只能有R.style

 在attrs.xml 中,查看是否已经建立方法,如下

<declare-styleable name="Topbar">
    <attr name="title" format="string" />
</declare-styleable>

 4、cannot resolve symbol ‘R’

 一般是自动的,如果出现这种问题,可以在java文件夹里新建R.java文件,我最后是重新建立 module 解决的- -


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值