首先讲解一下底部弹窗的思路:
1.弹出的窗口也是一种布局,并不是固定的格式,需要我们自己去设置这个布局
2.弹窗的位置我们是可以自己去设置的,当然,具体的设置步骤需要自己去实现了(我不会告诉你们其他的我没有去学习的)
3.打开弹窗一般有一些动画效果,所以如果需要自己的弹窗变得生动,可以去设置动画效果
然后,这里给一个贴图,这里弹窗的触发事件就只是简单的点击TextView(HelloWorld)
然后弹窗的布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/take_photo_from_camera"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/select_from_album"
android:layout_alignParentStart="true"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:background="@drawable/btn_bg"
android:text="@string/take_photo" />
<Button
android:id="@+id/select_from_album"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="25dp"