如何在Android应用中添加一个自定义弹框?很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。
实现步骤:
1.xml布局实现
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/store_bgimg"> <RelativeLayout android:layout_width="fill_parent" android:layout_height="214dp" android:layout_centerVertical="true" android:layout_marginLeft="31dp" android:layout_marginRight="31dp" android:background="@drawable/tkbjzj"> <TextView android:id="@+id/tetle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginTop="26dp" android:text="七天连锁酒店" android:textColor="#262626" android:textSize="18dp" /> <TextView android:id="@+id/textdz" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/tetle" android:layout_centerHorizontal="true" android:layout_marginTop="34dp" android:text="你已领取本店7.5折优惠券" android:textColor="#ea302e" /> <View android:layout_width="match_parent" android:layout_height="0.5dp" android:layout_above="@+id/lineardb" android:background="#e6e6e6" /> <LinearLayout android:id="@+id/lineardb" android:layout_width="match_parent" android:layout_height="44dp" android:layout_alignParentBottom="true"> <TextView android:id="@+id/textwzdl" android:layout_width="0dp" android:layout_height="fill_parent" android:layout_weight="1" android:gravity="center" android:text="我知道了" android:textColor="#262626" android:textSize="16dp" /> <TextView android:id="@+id/textckxq" android:layout_width="0dp" android:layout_height="fill_parent" android:layout_weight="1" android:background="#f86c6a" android:gravity="center" android:text="查看详情" android:textColor="#ffffff" android:textSize="16dp" /> </LinearLayout> </RelativeLayout> </RelativeLayout>
网页题目:如何在Android应用中添加一个自定义弹框-创新互联
本文URL:https://www.cdcxhl.com/article40/cedcho.html
成都网站建设公司_创新互联,为您提供品牌网站建设、网站营销、Google、搜索引擎优化、网页设计公司、品牌网站设计
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联