【问题标题】:Android - How to improve ListView performance when setting Theme.Translucent.NoTitleBar in Activity?Android - 如何在 Activity 中设置 Theme.Translucent.NoTitleBar 时提高 ListView 的性能?
【发布时间】:2011-09-14 13:10:35
【问题描述】:

我有一个活动,Theme.Translucent.NoTitleBar 在 manifest.xml 中设置为活动的样式属性。

<activity android:theme="@android:style/Theme.Translucent.NoTitleBar"/>

我需要它,因为在启动 Activity 时,我会从底部到顶部为该 Activity 的 rootlayout 设置动画(就像 iPhone 上的 ModalPresentation 一样),并且我不想在此动画期间使用黑色背景。

一切正常,但是我在这个rootlayout中放入的ListView在应用半透明主题后性能很慢。

我已经尝试设置 ListView 和 rootlayout 的 BackgroundColors,但似乎 android 在绘图时仍然考虑透明度。

【问题讨论】:

  • 能否请您发布您运行的代码?

标签: android performance listview scroll translucency


【解决方案1】:

您是否尝试过:getWindow().setFormat(PixelFormat.RGBA_4444); in onCreate()?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-29
    • 2018-10-14
    • 1970-01-01
    • 2012-07-13
    • 2016-10-26
    • 2013-02-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多