Skip to content
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

Dialog的背景颜色还是不能设置成透明的 #10

Closed
csshine opened this issue Apr 10, 2018 · 6 comments
Closed

Dialog的背景颜色还是不能设置成透明的 #10

csshine opened this issue Apr 10, 2018 · 6 comments

Comments

@csshine
Copy link

csshine commented Apr 10, 2018

看了新改的代码,只是改了view的背景。dialog颜色还是白色

可参考:
https://www.jianshu.com/p/b5b265aa54e0
https://www.jianshu.com/p/ff948975789a

@zyao89
Copy link
Owner

zyao89 commented Apr 10, 2018

你可以通过设置主题,自己改动的。

@csshine
Copy link
Author

csshine commented Apr 12, 2018

我这么写的:

<style name="zloading_alert_dialog" parent="android:Theme.Dialog">
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowFullscreen">false</item>
        <item name="android:windowBackground">@color/transparent</item>
        <item name="android:windowAnimationStyle">@null</item>
        <item name="android:backgroundDimEnabled">true</item>
        <item name="android:backgroundDimAmount">0.4</item>
    </style>
customProgressDialog = MyZloadingProgressDialog(context, R.style.zloading_alert_dialog)
class MyZloadingProgressDialog(context: Context, themeRes: Int) : ZLoadingDialog(context, themeRes) {}

观察:

public ZLoadingDialog(@NonNull Context context, int themeResId)
    {
        this.mContext = new WeakReference<>(context);
        this.mThemeResId = themeResId;
    }

调用了

但是出来的dialog还是白底不透明的呢?

@zyao89
Copy link
Owner

zyao89 commented Apr 12, 2018

😄,不好意思,一开始没有理解你说的意思。
现再 1.1.2中更新了 setDialogBackgroundColor 接口,并对透明度进行了支持。
很高兴收到你的意见。谢谢支持。

Color.parseColor("#cc111111"), 可以这样,或其它。

@zyao89 zyao89 closed this as completed Apr 12, 2018
@csshine
Copy link
Author

csshine commented Apr 13, 2018

Ok 现在对了 :)

@csshine
Copy link
Author

csshine commented Apr 13, 2018

3Q

@zhangqingshuang
Copy link

代码调用方式非布局方式,dialog大小能否改变,类似微信那种

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

3 participants