<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:orientation="vertical"> <!--
app:backgroundTint="#ff0000" 设置背景颜色
app:fabSize="normal" 在包括图片以外,还会预留一些间隔。
app:elevation="20dp" 控制(图片周围)阴影大小
app:rippleColor="#000000" 按钮点击时的颜色
-->
<android.support.design.widget.FloatingActionButton
android:id="@+id/faBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher"
app:backgroundTint="#ff0000"
app:fabSize="normal"
app:elevation="20dp"
app:rippleColor="#000000"
/> </LinearLayout>
 final FloatingActionButton faBtn = (FloatingActionButton) this.findViewById(R.id.faBtn);
faBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final Snackbar snackbar = Snackbar.make(faBtn, "你点击按钮", Snackbar.LENGTH_LONG);
snackbar.show();
snackbar.setAction("知道了", new View.OnClickListener() {
@Override
public void onClick(View v) {
snackbar.dismiss();
}
});
}
});

60、常规控件(3)Snackbar-可操作的提示框,Toast升级版的更多相关文章

  1. ValidationSummary控件不弹出错误提示框

    采用VS2013 编写的前台,运用ValidationSummary控件时,不出现错误弹窗,网上找到了解决方法 发现是ASP.NET 4.5对验证控件的影响(兼容性),使用ASP.NET 4.5的解决 ...

  2. 59、常规控件(2)TextInputLayout-让EditText提示更加人性化

    提示语用在显示. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" andro ...

  3. [ PyQt入门教程 ] PyQt5基本控件使用:单选按钮、复选框、下拉框

    本文主要介绍PyQt5界面最基本使用的单选按钮.复选框.下拉框三种控件的使用方法进行介绍. 1.RadioButton单选按钮/CheckBox复选框.需要知道如何判断单选按钮是否被选中. 2.Com ...

  4. WPF 控件被禁用,悬浮提示不显示问题

    原文:WPF 控件被禁用,悬浮提示不显示问题 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/BYH371256/article/details/89 ...

  5. Android AutoCompleteTextView控件实现类似百度搜索提示,限制输入数字长度

    Android AutoCompleteTextView 控件实现类似被搜索提示,效果如下 1.首先贴出布局代码 activity_main.xml: <?xml version="1 ...

  6. Android M 控件:Snackbar、Toolbar、TabLayout、NavigationView

    Snackbar Snackbar提供了一个介于Toast和AlertDialog之间轻量级控件,它可以很方便的提供消息的提示和动作反馈.Snackbar的使用与Toast的使用基本相同: Snack ...

  7. 61、常规控件(4)TabLayout-便捷实现标签

    <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout_width=&q ...

  8. bootstrap日期控件在火狐下的模态框中选择时间下拉菜单无效的解决办法

    今天收到程序组提交的一个兼容BUG,在火狐中使用模态框加载日期控件时选择时间下拉菜单没有效果(不能点击),而在谷歌中却是好的, 排错思路:1,在当前页面主层放置一个时间控件,测试通过 2,在ajax加 ...

  9. 安卓学习之--UI控件用法 单选 按钮 下拉框

    1.单选 .RadioGroup 可将各自不同的RadioButton ,设限于同一个Radio 按钮组,同一个RadioGroup 组里的按钮,只能做出单一选择(单选题). <RadioGro ...

随机推荐

  1. Python-Sublime Text3 激活码

    1.点击菜单-help-Enter License 2.输入以下内容中的一个 —– BEGIN LICENSE —– Michael Barnes Single User License EA7E- ...

  2. RS:关于数据挖掘中的推荐系统

    一.推荐系统概述和常用评价指标 1.1 推荐系统的特点 在知乎搜了一下推荐系统,果真结果比较少,显得小众一些,然后大家对推荐系统普遍的观点是: (1)重要性UI>数据>算法,就是推荐系统中 ...

  3. Docker运行报Cannot connect to the Docker daemon错误

    核心问题所在:权限不足 操作docker命令提示:Cannot connect to the Docker daemon 请切换管理员权限,root权限,root安装的一般的用户访问会存在此问题.

  4. crc16 校验算法 C#

    封装一个静态类 using System; using System.Collections.Generic; using System.Linq; using System.Text; using ...

  5. Vmware虚拟机三种网络模式详解(转)

    原文来自http://note.youdao.com/share/web/file.html?id=236896997b6ffbaa8e0d92eacd13abbf&type=note 我怕链 ...

  6. web ul li

    <html> <head> <style type="text/css"> ul{float:right} ul li{float:left; ...

  7. makefile之shell函数

    shell函数不同于除"wildcard"函数之外的其它函数.make可以使用它来和外部通信. 函数功能:函数"shell"所实现的功能和shell中的引用(` ...

  8. JS高程3:错误处理和调试

    浏览器打开控制台的快捷键 Ctrl+shift+I try-catch语句 语法 try{ // 可能会导致错误的代码 } catch(error){ // 在错误发生时怎么处理 } 可以自定义错误信 ...

  9. CCNA2.0笔记_安全管理设备

    设备安全 配置Console密码 Switch(config)#line console 0 Switch(config-line)#login Switch(config-line)#passwor ...

  10. Linux压缩解压缩命令学习笔记

    Linux中主要的压缩文件有:*.gz   *.tar  *.tar.gz  *.zip  *.bz2  *.tar.bz2 .zip这种古老的压缩格式,在window和Linux中都不需要安装软件可 ...