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,每次弹出来都是浮动在在一个新界面(activity), #48

Closed
GuodongQi opened this issue Sep 28, 2017 · 9 comments

Comments

@GuodongQi
Copy link

GuodongQi commented Sep 28, 2017

而不是像demo一样浮动在原来的界面

重写的showVersionDialog()方法,用了
versionDialog.setContentView(R.layout.activity_version_update_dialog);

@GuodongQi
Copy link
Author

然后今天发现,只要builder设置CustomDownloadActivityClass(MyVersionUpdateDialogActivity.class)时,即使MyVersionUpdateDialogActivity 仅继承VersionDialogActivity,其他内容为空时,也会出现这个问题。

@AlexLiuSheng
Copy link
Owner

设置activity Theme

@GuodongQi
Copy link
Author

设置过了
一套用了网上的常用的透明theme,不行
另一套用了你的的basedialog theme也不行

@AlexLiuSheng
Copy link
Owner

你的MyVersionUpdateDialogActivity 设置了android:theme="@style/versionCheckLibvtransparentTheme"没有

@GuodongQi
Copy link
Author

GuodongQi commented Sep 29, 2017

设置过,但一设置就报错 Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
主题代码如下

<style name="BaseDialog" parent="android:Theme.Light">
    <item name="android:windowFrame">@null</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:windowContentOverlay">@null</item>

</style>

这俩style都不可以

@GuodongQi
Copy link
Author

<style name="activity_version_update_dialog" parent="android:style/Theme.Dialog"> @null @android:color/transparent true true false </style>

@AlexLiuSheng
Copy link
Owner

android:theme="@style/versionCheckLibvtransparentTheme" 老铁库自带就有个

@AlexLiuSheng
Copy link
Owner

android:theme="@style/versionCheckLibvtransparentTheme"

@GuodongQi
Copy link
Author

GuodongQi commented Sep 29, 2017

@AlexLiuSheng扎心了老铁,已解决
😂thanks

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

2 participants