且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

安卓achartengine:试图导出图像为图像抛出异常

更新时间:2023-11-19 14:15:16

每的 http://developer.android.com/reference/android/view/View.html#getLayoutParams()该方法返回

...布局参数。这些电源参数这种观点的家长   指定应该如何安排。

... layout parameters. These supply parameters to the parent of this view specifying how it should be arranged.

即。这些输入到布局的计算:

i.e. these are inputs to the layout computation:

的LayoutParams ......描述的观点有多大希望是宽度和高度。对于每一个   尺寸,它可以指定一个确切的数字之一,MATCH_PARENT,WR​​AP_CONTENT

LayoutParams ... describes how big the view wants to be for both width and height. For each dimension, it can specify one of an exact number, MATCH_PARENT, WRAP_CONTENT

您需要的实际视图大小,也就是布局计算的结果。

You need the actual View size, that is, the result of the layout computation.

如果这种观点是已经奠定了在屏幕上,则 view.getWidth() view.getHeight()应该回到它的实际大小。在这种情况下,调用 view.layout(...)可以把显示视图在一个奇怪的状态,你应该恢复,并再次要通过实际大小的信息,没有布局PARAMS。

If this View is already laid out on screen, then view.getWidth() and view.getHeight() should return its actual size. In that case, calling view.layout(...) may put the displayed View in a weird state that you should restore, and again you want to pass actual size info, not layout params.

如果这种观点并不在屏幕上,则 view.measure(widthMeasureSpec,heightMeasureSpec)应该是所谓的前 view.layout(。 ..)。请阅读视图文档。

If this View is not on screen, then view.measure(widthMeasureSpec, heightMeasureSpec) is supposed to be called before view.layout(...). Do read the View docs.