SurfaceView setMeasuredDimension()与高度比4096更大的崩溃 [英] SurfaceView setMeasuredDimension() with height greater than 4096 crashes

查看:527
本文介绍了SurfaceView setMeasuredDimension()与高度比4096更大的崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用 surfaceview 在我的工作。我的要求是使一个弯曲线在垂直滚动视图。当我测试它,我发现当高度小于4096它工作得很好,但更重要的(甚至只是4097),它崩溃!

I'm using surfaceview in my work. My requirement is to make a curved line in a vertical scrollview. When I test it I found when the height is less than 4096 it works well, but more than that (even just 4097), it crashes!

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    // TODO Auto-generated method stub
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), 4097);
}

谁能告诉我为什么吗?

Can anyone tell me why?

推荐答案

的原因可能我你的设备的最大支持的纹理大小。

The reason might me the max supported texture size of your device.

这似乎是4096在case.You不应该为你的面用更大的价值。

Which seem to be 4096 in your case.You should not use bigger values for your surface.

看看:
<一href=\"http://stackoverflow.com/questions/4527695/how-an-i-find-the-maximum-texture-size-for-different-phones\">how一个我觉得最大纹理大小不同的手机?

找到支持哪些纹理​​尺寸

to find what texture sizes are supported

这篇关于SurfaceView setMeasuredDimension()与高度比4096更大的崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆