「已注销」 2016-07-09 15:28 采纳率: 100%
浏览 2200
已采纳

Tip: Use View.isInEditMode() in your custom views

在哪个地方加上if(!isInEditMode()){}? 我该怎么找到错误呢

Missing styles. Is the correct theme chosen for this layout?
Use the Theme combo box above the layout to choose a different layout, or fix the theme style references.

Failed to parse file D:\rupeng.workPlace\androidProject1\appcompat_v7\res\layout\select_dialog_item_material.xml
Couldn't find theme resource ?attr/listPreferredItemPaddingLeft for the current theme
Couldn't find theme resource ?attr/listPreferredItemPaddingRight for the current theme
Couldn't find theme resource ?attr/listPreferredItemHeightSmall for the current theme
"?attr/listPreferredItemPaddingLeft" in attribute "paddingLeft" is not a valid format.
"?attr/listPreferredItemPaddingRight" in attribute "paddingRight" is not a valid format.
"?attr/listPreferredItemHeightSmall" in attribute "minHeight" is not a valid format.
Couldn't find theme resource ?attr/textAppearanceListItemSmall for the current theme
Exception details are logged in Window > Show View > Error Log
The following classes could not be found:

  • TextView (Change to android.widget.TextView, Fix Build Path, Edit XML) The following classes could not be instantiated:
  • com.handmark.pulltorefresh.library.PullToRefreshListView (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.view.InflateException
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:372)
at android.view.BridgeInflater.inflate(BridgeInflater.java:183)
at com.handmark.pulltorefresh.library.internal.LoadingLayout.(LoadingLayout.java:78)
at com.handmark.pulltorefresh.library.internal.RotateLoadingLayout.(RotateLoadingLayout.java:42)
at com.handmark.pulltorefresh.library.PullToRefreshBase$AnimationStyle.createLoadingLayout(PullToRefreshBase.java:1545)
at com.handmark.pulltorefresh.library.PullToRefreshBase.createLoadingLayout(PullToRefreshBase.java:676)
at com.handmark.pulltorefresh.library.PullToRefreshBase.init(PullToRefreshBase.java:1286)
at com.handmark.pulltorefresh.library.PullToRefreshBase.(PullToRefreshBase.java:116)
at com.handmark.pulltorefresh.library.PullToRefreshAdapterViewBase.(PullToRefreshAdapterViewBase.java:74)
at com.handmark.pulltorefresh.library.PullToRefreshListView.(PullToRefreshListView.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-2)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:438)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:190)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:206)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:131)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:739)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:711)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:372)

  • 写回答

1条回答 默认 最新

  • Robot-C 2016-07-09 16:00
    关注

    经常打开别人的工程,发现layout里面使用了一些第三方的自定义控件,Graphical Layout标签里是无法预览页面的,抛出一些异常,上图吧:对于提示Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse。或者直接抛出的java.lang.NullPointerException......
    答案就在这里:Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
    ----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 一道python难题2
  • ¥15 一道python难题
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备