android自定义dialog style,Android 自定义 Style 实现一个简洁、美观、通用 Dialog

Android 自定义 Style 实现一个简洁、美观、通用 Dialog

 0

 358

042083b243c3e394a5440ac88898c8ce.png

另一棵树

2b878a189284c767e37667581662baf0.gif

2019/7/30 23:12:44

效果图

img[/layedit/img/201907302310083497.gif]

实现步骤

首先,我给它设定了一个风格,也就是对我们对话框一些必要属性的设置,它是一个style资源文件,如下

[pre]

@android:color/transparent

true

@null

true

false

[/pre]

其次,我们对它的xml布局文件进行绑定,下边是我们布局代码

[pre]

android:layout_width="match_parent"

android:layout_height="match_parent"

xmlns:tools="http://schemas.android.com/tools"

android:background="#11ffffff">

android:layout_width="260dp"

android:layout_height="wrap_content"

android:layout_centerInParent="true"

android:background="@drawable/usual_dialog_shape"

android:orientation="vertical">

android:id="@+id/tv_title"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center"

android:layout_margin="15dp"

android:gravity="center"

tools:text="消息提示"

android:textColor="#38ADFF"

android:textSize="16sp" />

android:id="@+id/tv_message"

android:layout_width="wrap_content"

androi

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值