我已经尝试了一切,并搜索了整个网络,但仍然没有任何作用.
这是我的设计师设计的背景:
在这里它在我的屏幕上看起来如何(Galaxy S I9000):
我试图用这段代码启用抖动:
findViewById(R.id.LinearLayout_Main).getBackground().setDither(true);
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
Window window = getWindow();
window.setFormat(PixelFormat.RGBA_8888);
}
Run Code Online (Sandbox Code Playgroud)
谁能告诉我为什么?
我想,这篇文章对你很有意思:
你也可以在这里阅读有关抖动背景的信息
android:dither ="true"没有抖动,有什么不对?
最后的建议来自Android Google网上论坛
使用gradient proxy drawable shape
而不是@drawable/image
像这样:
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/image"
android:dither="true" />
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3795 次 |
最近记录: |