Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/385.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 以编程方式设置android:windowIsFloating_Java_Android_Xml_Android Resources - Fatal编程技术网

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
}