其他分享
首页 > 其他分享> > android-使用滚动页面卷曲库的页面卷曲效果,页面背景显示为黑色边框代替透明度.

android-使用滚动页面卷曲库的页面卷曲效果,页面背景显示为黑色边框代替透明度.

作者:互联网

嗨,我正在使用Harism库进行页面卷曲效果
(https://github.com/harism/android_page_curl).效果正常,但是我的页面背景有一些透明的部分,显示为黑色.我已经尝试过在github论坛(https://github.com/harism/android_page_curl/issues/25)中提到的解决方案,但该解决方案无法正常工作.您也可以在那里查询我的查询.您也可以检查所附的屏幕快照.enter image description here

谢谢!

解决方法:

    Comments these lines in the activity
                   r.left += border;
                   r.right -= border;
                   r.top += border;
                   r.bottom -= border;

                    r.left += ((r.width() - imageWidth) / 2) - border;
                    r.right = r.left + imageWidth + border + border;
                    r.top += ((r.height() - imageHeight) / 2) - border;
                    r.bottom = r.top + imageHeight + border + border;
replace this function in the CurlView Activity

public void setMargins(float left, float top, float right, float bottom) {
        mRenderer.setMargins(left, top, right, bottom);
    }

标签:glsurfaceview,page-curl,android
来源: https://codeday.me/bug/20191111/2021026.html