Java 以编程方式设置android:windowIsFloating
如何以编程方式设置以下“活动样式”属性Java 以编程方式设置android:windowIsFloating,java,android,xml,android-resources,Java,Android,Xml,Android Resources,如何以编程方式设置以下“活动样式”属性 <item name="android:windowIsFloating">true</item> true 一种可能的解决方案是只使用窗口浮动属性集创建新样式。然后,覆盖目标活动上的getTheme方法以设置该样式。(假设AppTheme.NoActionBar是您当前的样式) styles.xml 也许,你找到解决办法了吗? <style name="MyCustomStyle" parent="Ap
<item name="android:windowIsFloating">true</item>
true
一种可能的解决方案是只使用窗口浮动
属性集创建新样式。然后,覆盖目标活动上的getTheme
方法以设置该样式。(假设AppTheme.NoActionBar
是您当前的样式)
styles.xml
也许,你找到解决办法了吗?
<style name="MyCustomStyle" parent="AppTheme.NoActionBar">
<item name="android:windowIsFloating">true</item>
</style>
@Override
public Resources.Theme getTheme() {
Resources.Theme theme = super.getTheme()
theme.applyStyle(R.style. MyCustomStyle, true)
return theme
}