binIoter / GuideView

东半球最好用的新手引导库,能够快速为任何一个View创建一个遮罩层,支持单个页面,多个引导串联展示,支持为高亮区域设置不同的图形,支持引导动画,方便扩展,良好支持fragment
3.96k stars 651 forks source link

Component中getFitPosition指定FIT_CENTER位置显示不正确 #59

Open imxiaopeng opened 4 years ago

imxiaopeng commented 4 years ago

private void verticalChildPositionLayout(View child, RectF rect, int targetParentPosition) { switch (targetParentPosition) { case LayoutParams.PARENT_CENTER: //rect.top = (mTargetRect.width() - child.getMeasuredHeight()) / 2; //rect.bottom = (mTargetRect.width() + child.getMeasuredHeight()) / 2; 应改为: rect.top = (mTargetRect.height() - child.getMeasuredHeight()) / 2; rect.bottom = (mTargetRect.height() + child.getMeasuredHeight()) / 2;

            rect.offset(0, mTargetRect.top);
            break;
    }
}