当我复制一些TableRows时,“预览超时,而呈现布局无限循环或无限recursion”

我只是做一个应用程序,将作为答案。 我保持TableLayout包含在行中的各种问题和他们在列中的多个select
所以我“复制”这个TableRow代码11次11个问题

<TableRow android:layout_height="wrap_content" android:layout_width="wrap_content" android:orientation="horizontal"> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="1" android:textSize="24sp"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="A"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="B"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="C"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="D"/> <CheckBox android:layout_height="wrap_content" android:layout_width="wrap_content"/> </TableRow> 

但有渲染错误说'无限循环或无限recursion'

我的activity_main.xml文件

 <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="5" android:layout_column="5" android:background="@android:color/holo_blue_dark"> <TableRow android:layout_height="wrap_content" android:layout_width="wrap_content" android:orientation="horizontal"> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="1" android:textSize="24sp"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="A"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="B"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="C"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="D"/> <CheckBox android:layout_height="wrap_content" android:layout_width="wrap_content"/> </TableRow> <TableRow android:layout_height="wrap_content" android:layout_width="wrap_content" android:orientation="horizontal"> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="1" android:textSize="24sp"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="A"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="B"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="C"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="D"/> <CheckBox android:layout_height="wrap_content" android:layout_width="wrap_content"/> </TableRow> </TableLayout> 

我想用这个11个问题来创build这样的东西

这里是堆栈跟踪

 java.util.concurrent.TimeoutException: Preview timed out while rendering the layout. This typically happens when there is an infinite loop or unbounded recursion in one of the custom views. at java.util.ArrayList.indexOf(ArrayList.java:317) at java.util.ArrayList.contains(ArrayList.java:300) at com.android.layoutlib.bridge.impl.DelegateManager.addNewDelegate(DelegateManager.java:132) at android.graphics.drawable.VectorDrawable_Delegate.nCreateTree(VectorDrawable_Delegate.java:94) at android.graphics.drawable.VectorDrawable.nCreateTree(VectorDrawable.java) at android.graphics.drawable.VectorDrawable.access$300(VectorDrawable.java:204) at android.graphics.drawable.VectorDrawable$VectorDrawableState.createNativeTree(VectorDrawable.java:824) at android.graphics.drawable.VectorDrawable$VectorDrawableState.access$000(VectorDrawable.java:761) at android.graphics.drawable.VectorDrawable.inflate(VectorDrawable.java:581) at android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:130) at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1224) at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1197) at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:316) at android.content.res.Resources_Delegate.getDrawable(Resources_Delegate.java:142) at android.content.res.Resources.getDrawable(Resources.java:763) at android.graphics.drawable.AnimatedVectorDrawable.inflate(AnimatedVectorDrawable.java:373) at android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:130) at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1224) at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1197) at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:316) at android.content.res.BridgeTypedArray.getDrawable(BridgeTypedArray.java:687) at android.graphics.drawable.AnimatedStateListDrawable.parseTransition(AnimatedStateListDrawable.java:473) at android.graphics.drawable.AnimatedStateListDrawable.inflateChildElements(AnimatedStateListDrawable.java:455) at android.graphics.drawable.AnimatedStateListDrawable.inflate(AnimatedStateListDrawable.java:385) at android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:130) at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1224) at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1197) at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:316) at android.content.res.Resources_Delegate.getDrawable(Resources_Delegate.java:142) at android.content.res.Resources.getDrawable(Resources.java:763) at android.support.v7.widget.ResourcesWrapper.getDrawable(ResourcesWrapper.java:133) at android.content.Context.getDrawable(Context.java:525) at android.support.v4.content.ContextCompatApi21.getDrawable(ContextCompatApi21.java:26) at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:352) at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193) at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:181) at android.support.v7.widget.AppCompatCompoundButtonHelper.loadFromAttributes(AppCompatCompoundButtonHelper.java:64) at android.support.v7.widget.AppCompatCheckBox.<init>(AppCompatCheckBox.java:61) at android.support.v7.widget.AppCompatCheckBox.<init>(AppCompatCheckBox.java:54) at sun.reflect.GeneratedConstructorAccessor363.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:465) at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:172) at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:105) at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:186) at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:312) at android.view.BridgeInflater.onCreateView(BridgeInflater.java:141) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:717) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:785) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:210) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70) at android.view.LayoutInflater.rInflate(LayoutInflater.java:834) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:861) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70) at android.view.LayoutInflater.rInflate(LayoutInflater.java:834) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) at android.view.LayoutInflater.inflate(LayoutInflater.java:518) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:317) at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429) at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:389) at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:548) at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:533) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966) at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:533) at com.android.tools.idea.rendering.RenderTask.lambda$inflate$61(RenderTask.java:659) at com.android.tools.idea.rendering.RenderTask$$Lambda$141/4860208.call(Unknown Source) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 

Solutions Collecting From Web of "当我复制一些TableRows时,“预览超时,而呈现布局无限循环或无限recursion”"

尝试这个:

build立 – >重build项目

这有助于我摆脱这个错误。 我没有改变我的任何代码。

  • 构buildAPK
  • 重build项目

这会做

对我来说,重新启动Android工作室干净的构build后工作。