Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shape round rect太大,无法在android中渲染为纹理_Android_Performance_Android Layout_Gridview - Fatal编程技术网

Shape round rect太大,无法在android中渲染为纹理

Shape round rect太大,无法在android中渲染为纹理,android,performance,android-layout,gridview,Android,Performance,Android Layout,Gridview,我正在为自定义gridview使用自定义形状 “栅格视图”属性: <com.View.UI.ExpandableHeightGridView android:id="@+id/issueList" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/archiveTitle" android:layout

我正在为自定义gridview使用自定义形状

“栅格视图”属性:

<com.View.UI.ExpandableHeightGridView
    android:id="@+id/issueList"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/archiveTitle"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:background="@drawable/customshape"
    android:numColumns="3"
    android:overScrollMode="never"
    android:scrollbars="none"
    android:isScrollContainer="false"
/>
以及自定义的_shape.xml


它适用于我的手机(更新),但当它在旧平板电脑上运行时,它显示的
Shape round rect太大,无法渲染为纹理
,它是一个网格视图,包含约40个元素,因此可能很高

如何修复它

public class ExpandableHeightGridView extends GridView{
    boolean expanded = false;

    public ExpandableHeightGridView(Context context)
    {
        super(context);
    }

    public ExpandableHeightGridView(Context context, AttributeSet attrs)
    {
        super(context, attrs);
    }

    public ExpandableHeightGridView(Context context, AttributeSet attrs,
            int defStyle)
    {
        super(context, attrs, defStyle);
    }

    public boolean isExpanded()
    {
        return expanded;
    }

    @Override
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
    {   
        if (isExpanded())
        {
            // Calculate entire height by providing a very large height hint.
            // View.MEASURED_SIZE_MASK represents the largest height possible.
            int expandSpec = MeasureSpec.makeMeasureSpec(MEASURED_SIZE_MASK,
                    MeasureSpec.AT_MOST);
            super.onMeasure(widthMeasureSpec, expandSpec);

//            ViewGroup.LayoutParams params = getLayoutParams();
//            params.height = getMeasuredHeight();
        }
        else
        {
            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        }
    }

    public void setExpanded(boolean expanded)
    {
        this.expanded = expanded;
    }
}
<solid android:color="#FFF" />

<stroke
    android:width="1dp"
    android:color="#808080" />

<corners android:radius="10dp" />