本文介绍了渲染渲染过程中提出的问题例外:颜色和位置数组必须是同等长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我得到在Android Studio中渲染错误。是否有人知道这是为什么原因引起的?

Hello i'm getting rendering errors in Android studio. Does someone know why this is caused?

我的XML:
    
    

My xml:

    <!-- ListRow Left side Thumbnail image -->

    <LinearLayout
        android:id="@+id/thumbnail"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_marginRight="5dip"
        android:background="@drawable/image_bg"
        android:padding="0dip" >

    <ImageView
         android:id="@+id/list_image"
         android:layout_width="50dip"
         android:layout_height="50dip"
         android:scaleType="centerCrop"
          />
    </LinearLayout>

    <TextView
        android:id="@+id/title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/thumbnail"
        android:layout_marginTop="0dip"
        android:layout_toRightOf="@+id/thumbnail"
        android:text="De Titel van het geweldige bericht"
        android:textColor="#60a926"
        android:textSize="15dip"
        android:textStyle="bold"
        android:ellipsize="end"
        android:typeface="sans" />

    <TextView
        android:id="@+id/subtitle"
        android:layout_width="match_parent"
        android:layout_height="25dp"
        android:layout_below="@id/title"
        android:layout_marginTop="0dip"
        android:layout_toLeftOf="@+id/imageView1"
        android:layout_toRightOf="@+id/thumbnail"
        android:text="Nieuwsbericht subtitel mooi iets ..."
        android:textStyle="bold"
        android:ellipsize="end"
        android:textColor="#9f9e9f"
        android:textSize="10dip" />


    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:src="@drawable/arrow" />

    <!-- datum van bericht -->
    <TextView
        android:id="@+id/date"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/artist"
        android:layout_alignTop="@+id/imageView1"
        android:layout_marginTop="18dp"
        android:layout_marginLeft="175dp"
        android:gravity="right"
        android:text=""
        android:textColor="#ffffff"
        android:textSize="10dip"
        android:textStyle="bold" />

</RelativeLayout>

当我使用的是活的preVIEW我得到这个错误:在渲染过程中提出的问题呈现异常:颜色和位置数组必须是同等长度

When i'm using the live preview i'm getting this error: "Rendering Problems Exception raised during rendering: color and position arrays must be of equal length"

这是一款Android工作室的错误?或者我做错了什么?

Is this a Android studio bug? or i am doing something wrong?

我希望有人有解决方案。

I hope someone has the solution.

推荐答案

我解决了这个问题,通过使用虚假的渐变样式文件引起的。删除梯度解决了这个问题。

I solved it the problem was caused by using a false gradient style file. Deleting the gradient solved the problem.

这篇关于渲染渲染过程中提出的问题例外:颜色和位置数组必须是同等长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 05:35