Shape round rect太大,无法在android中渲染为纹理
我正在为自定义gridview使用自定义形状 “栅格视图”属性: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
<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" />