Skip to content

ArrowDrawable设置阴影,箭头无法居中 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
android-1995 opened this issue Oct 14, 2019 · 0 comments
Closed

ArrowDrawable设置阴影,箭头无法居中 #7

android-1995 opened this issue Oct 14, 2019 · 0 comments

Comments

@android-1995
Copy link

android-1995 commented Oct 14, 2019

new SimpleTextTip(anchorView)
                .setTextContent("这个无法居中") // 设置浮窗文本内容
                .setTextPaddingDp(12) // 设置文字与浮窗边框的间距
                .setTextColor(Color.WHITE) // 设置文字颜色
                .setTextSizeSp(14) // 设置文字大小
                .setTextGravity(Gravity.CENTER) // 设置文字对其方式
                .setLineSpacingExtraDp(4) // 设置文字行间距

                .setArrowGravity(ArrowGravity.TO_BOTTOM_CENTER) // 设置箭头相对于浮窗的位置
                .setBgColor(Color.BLACK) // 设置背景色
                .setShadowColor(Color.parseColor("#33000000")) // 设置阴影色
                .setArrowHeightDp(6) // 设置箭头高度
                .setRadiusDp(4) // 设置浮窗圆角半径
                .setArrowOffsetXDp(0) // 设置箭头在 x 轴的偏移量
                .setArrowOffsetYDp(0) // 设置箭头在 y 轴的偏移量
                .setShadowSizeDp(6) // 设置阴影宽度

                .setTipGravity(TipGravity.TO_TOP_ALIGN_START) // 设置浮窗相对于锚点控件展示的位置
                .setTipOffsetXDp(0) // 设置浮窗在 x 轴的偏移量
                .setTipOffsetYDp(6) // 设置浮窗在 y 轴的偏移量

                .setBackgroundDimEnabled(false) // 设置是否允许浮窗的背景变暗
                .setDismissOnTouchOutside(true) // 设置点击浮窗外部时是否自动关闭浮窗

                .show(); // 显示浮窗
new SimpleTextTip(anchorView)
                .setTextContent("这个可以居中") // 设置浮窗文本内容
                .setTextPaddingDp(12) // 设置文字与浮窗边框的间距
                .setTextColor(Color.WHITE) // 设置文字颜色
                .setTextSizeSp(14) // 设置文字大小
                .setTextGravity(Gravity.CENTER) // 设置文字对其方式
                .setLineSpacingExtraDp(4) // 设置文字行间距

                .setArrowGravity(ArrowGravity.TO_BOTTOM_CENTER) // 设置箭头相对于浮窗的位置
                .setBgColor(Color.BLACK) // 设置背景色
                .setArrowHeightDp(6) // 设置箭头高度
                .setRadiusDp(4) // 设置浮窗圆角半径
                .setArrowOffsetXDp(0) // 设置箭头在 x 轴的偏移量
                .setArrowOffsetYDp(0) // 设置箭头在 y 轴的偏移量

                .setTipGravity(TipGravity.TO_TOP_ALIGN_START) // 设置浮窗相对于锚点控件展示的位置
                .setTipOffsetXDp(0) // 设置浮窗在 x 轴的偏移量
                .setTipOffsetYDp(6) // 设置浮窗在 y 轴的偏移量

                .setBackgroundDimEnabled(false) // 设置是否允许浮窗的背景变暗
                .setDismissOnTouchOutside(true) // 设置点击浮窗外部时是否自动关闭浮窗

                .show(); // 显示浮窗
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant