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

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 ansys fluent计算闪退
  • ¥15 有关wireshark抓包的问题
  • ¥15 需要写计算过程,不要写代码,求解答,数据都在图上
  • ¥15 向数据表用newid方式插入GUID问题
  • ¥15 multisim电路设计
  • ¥20 用keil,写代码解决两个问题,用库函数
  • ¥50 ID中开关量采样信号通道、以及程序流程的设计
  • ¥15 U-Mamba/nnunetv2固定随机数种子
  • ¥15 vba使用jmail发送邮件正文里面怎么加图片
  • ¥15 vb6.0如何向数据库中添加自动生成的字段数据。