本文整理了Java中android.view.SurfaceView.requestLayout()
方法的一些代码示例,展示了SurfaceView.requestLayout()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SurfaceView.requestLayout()
方法的具体详情如下:
包路径:android.view.SurfaceView
类名称:SurfaceView
方法名:requestLayout
暂无
代码示例来源:origin: Affectiva/android-sdk-samples
@SuppressWarnings("SuspiciousNameCombination")
@Override
public void onCameraSizeSelected(int width, int height, Frame.ROTATE rotate) {
if (rotate == Frame.ROTATE.BY_90_CCW || rotate == Frame.ROTATE.BY_90_CW) {
previewWidth = height;
previewHeight = width;
} else {
previewHeight = height;
previewWidth = width;
}
cameraPreview.requestLayout();
}
}
代码示例来源:origin: Affectiva/android-sdk-samples
/**
* Update the camera width and height variables, then request a resize of the SurfaceView.
* Notice that CameraHelper notifies us of the physical, pre-rotation width and height of the camera
* frames, so we need to account for possible rotation in this method.
*/
@Override
public void onFrameSizeSelected(int width, int height, Frame.ROTATE rotation) {
if (rotation == Frame.ROTATE.BY_90_CW || rotation == Frame.ROTATE.BY_90_CCW) {
previewHeight = width;
previewWidth = height;
} else {
previewWidth = width;
previewHeight = height;
}
surfaceView.requestLayout();
}
内容来源于网络,如有侵权,请联系作者删除!