Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse

NOTE: This project contains Java compilation errors, which can cause rendering failures for custom views. Fix compilation problems first.


Exception raised during rendering: <include /> can only be used inside of a ViewGroup
Exception details are logged in Window > Show View > Error Log
The following classes could not be instantiated:
- com.wust.widget.PullToRefreshLayout (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse


android.content.res.Resources$NotFoundException: Could not resolve resource value: 0x7F040002.
    at android.content.res.BridgeResources.throwException(BridgeResources.java:693)
    at android.content.res.BridgeResources.getAnimation(BridgeResources.java:305)
    at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:71)
    at com.wust.widget.PullToRefreshLayout.initView(PullToRefreshLayout.java:197)
    at com.wust.widget.PullToRefreshLayout.<init>(PullToRefreshLayout.java:185)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(    at sun.reflect.NativeConstructorAccessorImpl.newInstance(    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(    at java.lang.reflect.Constructor.newInstance(    at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:442)
    at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:194)
    at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:206)
    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:131)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:756)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:728)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:759)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:728)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:492)

    at android.view.LayoutInflater.inflate(LayoutInflater.java:373)


不知道这样的问题大家遇到过没有,很烦,找了好多错误没有找到,最后还是加   

if(!isInEditMode()){
//造成错误的代码段
}

才能解决问题。

虽然问题解决了,但是我觉得应该不是这样的错误

最开始我一直以为是style的问题,换了好多种都不行,因为在其他的项目中显示的非常正常,就只有style不同

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值