Android ViewPager玻璃背景 [英] Android viewpager glass background

查看:144
本文介绍了Android ViewPager玻璃背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了viewpager.我该如何给它一个玻璃效果背景,就像我们在android应用程序列表中看到的那样.

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

推荐答案

或者我认为您可以在xml中将背景色设置为

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

android:background="#80xxxxxx"

80是128 fpr的十六进制等效值,alpha值是半透明的

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

否则,在Java文件中

otherwise, in java file

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

希望这对您有帮助...

hope this helps...

这篇关于Android ViewPager玻璃背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆