怎样实现PopupWindow的背景渐变
展开全部
将整个布局外包裹一个相对布局,再在相对布局内添加一个线性或者相对布局,宽高match_parent,然后给相对布局第一个子布局设置背景并添加渐变动画,布局大概如下
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android" android:orientation = "vertical" android:layout_width = "fill_parent" android:layout_height = "fill_parent" > <RelativeLayout android:id = "@+id/gradient_layout" android:layout_width = "match_parent" android:background = "@drawable/ic_launcher" android:orientation="horizontal" android:contentDescription = "后台背景动画布局" android:layout_height = "match_parent" /> <LinearLayout android:background = "#d000000" android:layout_width = "match_parent" android:orientation = "vertical" android:contentDescription = "正常布局显示,背景可以透明或者半透明" android:layout_height = "match_parent" > <...../> </LinearLayout ></RelativeLayout >
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android" android:orientation = "vertical" android:layout_width = "fill_parent" android:layout_height = "fill_parent" > <RelativeLayout android:id = "@+id/gradient_layout" android:layout_width = "match_parent" android:background = "@drawable/ic_launcher" android:orientation="horizontal" android:contentDescription = "后台背景动画布局" android:layout_height = "match_parent" /> <LinearLayout android:background = "#d000000" android:layout_width = "match_parent" android:orientation = "vertical" android:contentDescription = "正常布局显示,背景可以透明或者半透明" android:layout_height = "match_parent" > <...../> </LinearLayout ></RelativeLayout >
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询