当前位置: 动力学知识库 > 问答 > 编程问答 >

android - Moving a view over the action bar leaves artifacts

问题描述:

i have tested a view moved by the finger, using TranslateX and TranslateY properties.

I works fine, but when the view is moved over the action bar it leaves a trailing artifact. The action bar does not redraw itselft at all.

What should be called to either redraw the action bar, or clip the view so it won't draw over the action bar ?

Context.InvalidateOptionsMenu(); does nothing at all.

网友答案:

You need to set a Background to the ActionBar:

ActionBar actionBar = getActionBar();
actionBar.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.screen_background_dark));

That did it for me;

分享给朋友:
您可能感兴趣的文章:
随机阅读: