bytedance/scene

SceneContainerActivity透明主题

Iridescentangle opened this issue · 4 comments

您好,我试图在应用中调用
new SceneNavigator(mTvMsg.getContext(), R.style.TranslucentActivity) .startScene(TranslateScene.class,bundle1);
主题R.style.TranslucentActivity内容如下

<style name="TranslucentActivity" parent="BaseTranslucentActivity"> @android:color/transparent @null true @android:style/Animation true @null </style>

经测试这个主题是有效的,但是启动SceneContainerActivity后效果如下
image
(请无视白边 电脑截图不是那么精准
好像设置的透明主题没有生效...

qii commented

难不成是框架拿背景色去补了次你的 TranslateScene 的背景(可你的背景色本来也是透明的)?SceneContainerActivity 里面 DelegateScene 的 PushOptions.Builder(),你要不加个 setTranslucent(true)

qii commented

唉,Android Activity 不支持从非透明主题切到透明主题,SceneContainerActivity 初始主题是非透明的

qii commented

一个恶心点的做法是你自己照着代码抄一个 TranslucentSceneContainerActivity 和 TranslucentSceneNavigator,默认主题用

    <style name="TranslucentTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:colorBackgroundCacheHint">@null</item>
        <item name="android:windowIsTranslucent">true</item>
    </style>

彳亍,我抄一遍吧,这个需求也许不是很常见,哈哈,多谢😝!!