本片文章主要谈探讨了如何实现在底部弹出提示框背景为半透明效果的实现。想要实现此种效果一般有两种方式一个是使用Activity设置Theme另一种方式就是使用PopupWindow设置样式实现效果。
一,使用Activity
首先是此activity的布局文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:background="#b0000000"
>
<LinearLayout
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:id="@+id/pop_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:layout_alignParentBottom="true"
android:background="@drawable/callsharp_select"
>
<Button
android: