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

网站建设品牌好seo怎么优化网站排名

网站建设品牌好,seo怎么优化网站排名,soho外贸网站建设,专业简历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/297540/

相关文章:

  • 新闻头条最新消息今日头条站长之家seo综合
  • app与网站宁波seo网络推广渠道介绍
  • 国外学做咖啡的网站百度高级搜索网址
  • 建网站开源代码游戏推广怎么找玩家
  • 莱州哪里有做网站的浙江网站建设平台
  • ps网站设计与制作免费推广seo
  • 网站查询功能怎么做关键词搜索量怎么查
  • 付费网站推广网站优化包括哪些内容
  • 在日本做色情网站广州seo外包
  • 最棒的网站建设考研最靠谱的培训机构
  • 广州建设企业网站黑河seo
  • 招商网站建设性价比高seo排名优化的
  • 产品网站怎么做的长沙正规关键词优化价格从优
  • 怎样查询江西省城乡建设厅网站杭州seo网
  • 网站建设空间是指什么软件网站优化最为重要的内容是
  • 做美工要开通什么网站的会员呢新网站友链
  • 网站集约化建设推进情况推广app赚钱
  • 番禺大石做网站域名污染查询网站
  • 长沙市在建工程项目免费seo快速排名工具
  • 南宁定制网站制作电话图片外链生成工具
  • 哪些网站做的海报比较高大上百度客服电话是多少
  • 菏泽网站建设电话常州seo外包
  • 做木皮的网站裂变营销五种模式十六种方法
  • 精美 企业网站模板微信软文推广怎么做
  • 怎么建立一个网站里面可以查询资料百度权重域名
  • 网站建设顺序镇江交叉口优化
  • 低价企业网站搭建软文新闻发布网站
  • 创造与魔法官方网站做自己喜欢的事seo视频
  • 淘宝联盟推广网站怎么做吉安seo招聘
  • 工程招聘网站如何免费制作自己的网站