当前位置: 首页 > news >正文

网站安全检测入口刷网站百度关键词软件

网站安全检测入口,刷网站百度关键词软件,微信公众号微商城平台,个人网站可以做资讯吗BottomSheetDialog 是Android开发中的一个弹出式对话框,它从屏幕底部弹出并覆盖部分主界面。 1. BottomSheetDialog的使用 // 参数2:设置BottomSheetDialog的主题样式;将背景设置为transparent,这样我们写的shape_bottom_sheet_…

BottomSheetDialog 是Android开发中的一个弹出式对话框,它从屏幕底部弹出并覆盖部分主界面。

1. BottomSheetDialog的使用

// 参数2:设置BottomSheetDialog的主题样式;将背景设置为transparent,这样我们写的shape_bottom_sheet_dialog.xml才会起作用
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this, R.style.BottomSheetDialog);
//不传第二个参数
//BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this);// 底部弹出的布局
View bottomView = LayoutInflater.from(requireContext()).inflate(R.layout.bottom_sheet_layout, null);bottomSheetDialog.setContentView(bottomView);
//设置点击dialog外部不消失
//bottomSheetDialog.setCanceledOnTouchOutside(false);
bottomSheetDialog.show();

2.加载布局

bottom_sheet_layout.xml ; 通过LayoutInflater拿到底部弹窗布局后,通过setContentView()把布局加载到BottomSheetDialog中。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="vertical"android:background="@drawable/shape_bottom_sheet_dialog"><TextViewandroid:id="@+id/choose_photo"android:layout_width="match_parent"android:layout_height="50dp"android:text="从手机相册选择"android:textSize="15sp"android:textColor="#191919"android:gravity="center"/><Viewandroid:layout_width="match_parent"android:layout_height="1dp"android:background="#F5F5F5"/><TextViewandroid:id="@+id/check_photo"android:layout_width="match_parent"android:layout_height="50dp"android:text="查看上一张头像"android:textSize="15sp"android:textColor="#191919"android:gravity="center"/><Viewandroid:layout_width="match_parent"android:layout_height="1dp"android:background="#F5F5F5"/><TextViewandroid:id="@+id/save_photo"android:layout_width="match_parent"android:layout_height="50dp"android:text="保存到手机"android:textSize="15sp"android:textColor="#191919"android:gravity="center"/><Viewandroid:layout_width="match_parent"android:layout_height="10dp"android:background="#F5F5F5"/><TextViewandroid:id="@+id/cancel"android:layout_width="match_parent"android:layout_height="50dp"android:text="取消"android:textSize="15sp"android:textColor="#191919"android:gravity="center"/></LinearLayout>

3.显示

通过调用  BottomSheetDialg.show()方法就能将底部弹窗给显示出来。

4. BottomSheetDialog 圆角设置

写一个shape,在Drawable下创建一shape_bottom_sheet_dialog.xml,里面设置圆角的样式。

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="rectangle"><corners android:topLeftRadius="@dimen/dime_10dp"android:topRightRadius="@dimen/dime_10dp"/><solid android:color="@color/white"/></shape>

把bottom_sheet_layout.xml的整个背景设置为shape_bottom_sheet_dialog.xml这个shape。

通过上面的设置,圆角效果并没有展示出来。 还需要将BottomSheetDialog的背景设置为透明。在themes.xml(res->values->themes)添加下面两个style。

    <!--实现BottomSheetDialog圆角效果--><style name="BottomSheetDialog" parent="Theme.Design.Light.BottomSheetDialog"><item name="bottomSheetStyle">@style/bottomSheetStyleWrapper</item></style><style name="bottomSheetStyleWrapper" parent="Widget.Design.BottomSheet.Modal"><item name="android:background">@android:color/transparent</item></style>

在new BottomSheetDialog()的第二个参数,传入这个style.

new BottomSheetDialog(this, R.style.BottomSheetDialog);

http://www.hkea.cn/news/331137/

相关文章:

  • 西部建设网站惠州seo排名优化
  • 做环球资源网站有没有效果2024百度下载
  • 织梦 安装网站网站搭建需要多少钱
  • 做网站购买备案域名性价比高seo的排名优化
  • 潍坊中脉网站建设公司淄博seo公司
  • 深圳做网站推广哪家好青岛关键词优化平台
  • 呼和浩特市网站建设公司uc搜索引擎入口
  • 网站怎么做关键词搜索电子商务主要学什么内容
  • python做的网站漏洞百度竞价推广开户联系方式
  • 做任务换流量的网站怎么自己制作网页
  • 福清建设局网站火蝠电商代运营公司
  • 爱玖货源站在线智能识图
  • 上海网络营销软件windows优化大师win10
  • 专做美妆的视频网站ui设计
  • 平度市建设局网站济宁百度推广价格
  • 茶类网站建设方案西安网站seo排名优化
  • 南和县住房和建设局网站石家庄整站优化技术
  • 做教育网站销售的好吗成都百度网站排名优化
  • 展览展会网页模板下载河南网站优化排名
  • 自己做网站上传视频疫情二十条优化措施
  • 网站排名上升 优帮云网络销售培训学校
  • 对于政务网站建设的建议网站收录优化
  • 网站策划与建设阶段的推广方法网络软文怎么写
  • 漳州公司做网站重庆网站建设
  • 十大网络平台有哪些网站关键词排名seo
  • 建b2c网站google官方下载安装
  • 广州b2b网站建设公司推广网站
  • 新乡市封丘县建设局网站百度教育官网登录入口
  • 网站开发项目点击器
  • 建公司网站需要多少钱推广普通话手抄报内容资料