2015-06-03 131 views
-1

我想創建一個像這樣的android屏幕 - 背景圖像褪色,並具有線性佈局,使圖像褪色。Android:創建褪色背景圖像

enter image description here

+1

給'image'爲'background'爲'ViewGroup'和使用'alpha' –

+1

製作圖片作爲背景,以您的佈局設置其不透明度,並賦予其alpha屬性,它會工作 –

+0

沒有,alpha將不起作用 – pskink

回答

1

這不是褪色的圖像,而是模糊的圖像。 更改alpha將會使圖像褪色而不會模糊它。

This可能有助於

1

這基本上是一個模糊圖像背景。您可以使用Photoshop等工具添加模糊效果,或者如果您正在尋找動態模糊效果,則可以使用StackBlur庫。

只需使用要模糊圖像初始化,

_stackBlurManager = new StackBlurManager(getBitmapFromAsset(this, "yourFile.png")); 

,並設置模糊半徑,

_stackBlurManager.process(progress*5); 

,然後設置模糊爲您的佈局或ImageView背景。

_imageView.setImageBitmap(_stackBlurManager.returnBlurredImage());