UIImplementation.java 文件源码

java
阅读 33 收藏 0 点赞 0 评论 0

项目:RNLearn_Project1 作者:
/**
 * Measures the view specified by tag relative to the given ancestorTag. This means that the
 * returned x, y are relative to the origin x, y of the ancestor view. Results are stored in the
 * given outputBuffer. We allow ancestor view and measured view to be the same, in which case
 * the position always will be (0, 0) and method will only measure the view dimensions.
 */
public void measureLayout(
    int tag,
    int ancestorTag,
    Callback errorCallback,
    Callback successCallback) {
  try {
    measureLayout(tag, ancestorTag, mMeasureBuffer);
    float relativeX = PixelUtil.toDIPFromPixel(mMeasureBuffer[0]);
    float relativeY = PixelUtil.toDIPFromPixel(mMeasureBuffer[1]);
    float width = PixelUtil.toDIPFromPixel(mMeasureBuffer[2]);
    float height = PixelUtil.toDIPFromPixel(mMeasureBuffer[3]);
    successCallback.invoke(relativeX, relativeY, width, height);
  } catch (IllegalViewOperationException e) {
    errorCallback.invoke(e.getMessage());
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号