Android viewpager glass background

2019-09-02 17:06发布

I have implemented viewpager. How can i give it a glass effect background, like the one we have for android applications list.

2条回答
可以哭但决不认输i
2楼-- · 2019-09-02 17:26

Or i think you can set your background colour either in xml as

android:background="#80xxxxxx"

80 is the hexa-decimal equivalent of 128 fpr the alpha value to be translucent

otherwise, in java file

bg.setColor(Color.argb(128, xxx, xxx, xxx));

hope this helps...

查看更多
Emotional °昔
3楼-- · 2019-09-02 17:28

I think you want a background for your Activity, in which you can see things at the back side of your Activity. For this, you can use a "Translucent" theme for your activity and also set a Background Image of your activity which can be a little blurry.

查看更多
登录 后发表回答