android气泡消息提醒布局
无论是anroid还是ios,气泡消息提醒再正常不过了。然而要定义一个气泡消息提醒确要费一番周折。下面记录下气泡提醒布局。
定义气泡背景shape_unread_message_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android= "http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel= "false" > <solid android:color= "#FF0000" /> </shape>
定义气泡布局,关键点是android:layout_gravity="top|right"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"> <ImageView
android:id="@+id/img_cells"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/ic_launcher" />
<TextView
android:id="@+id/tab_unread_message"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignParentRight="true"
android:layout_marginRight="14dp"
android:background="@drawable/shape_unread_message_bg"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="8sp"
android:layout_gravity="top|right"
android:visibility="gone"
/>
</FrameLayout>
此处需要注意的是,如果数字过大。出现"..."时无法居中,其实这是英文"..."导致的问题,换成"···"即可。
android气泡消息提醒布局的更多相关文章
- Android实例-设置消息提醒(XE8+小米2)
相关资料: 1.官网实例:http://docwiki.embarcadero.com/RADStudio/XE5/en/Mobile_Tutorial:_Using_the_Notification ...
- android的消息通知栏
在android的应用层中,涉及到很多应用框架,例如:Service框架,Activity管理机制,Broadcast机制,对话框框架,标题栏框架,状态栏框架,通知机制,ActionBar框架等等. ...
- 第13讲- Android之消息提示Notification
第13讲 Android之消息提示Notification .Notification Notification可以理解为通知的意思一般用来显示广播信息,通知可以显示到系统的上方的状态栏(status ...
- cordova-plugin-local-notifications发送Android本地消息
原文:cordova-plugin-local-notifications发送Android本地消息 1.GitHub源代码地址: https://github.com/katzer/cordova- ...
- PHP实现RTX发送消息提醒
RTX是腾讯公司推出的企业级即时通信平台,大多数公司都在使用它,但是我们很多时候需要将自己系统或者产品的一些通知实时推送给RTX,这就需要用到RTX的服务端SDK,建议先去看看RTX的SDK开发文档( ...
- Android中的LinearLayout布局
LinearLayout : 线性布局 在一般情况下,当有很多控件需要在一个界面列出来时,我们就可以使用线性布局(LinearLayout)了, 线性布局是按照垂直方向(vertical)或水平方向 ...
- Android开发-之五大布局
在html中大家都知道布局是什么意思了,简单来说就是将页面划分模块,比如html中的div.table等.那么Android中也是这样的.Android五大布局让界面更加美化,开发起来也更加方便.当然 ...
- 使用SignalR实现消息提醒
Asp.net SignalR是微软为实现实时通信的一个类库.一般情况下,SignalR会使用JavaScript的长轮询(long polling)的方式来实现客户端和服务器通信,随着Html5中W ...
- 简单研究Android View绘制三 布局过程
2015-07-28 17:29:19 这一篇主要看看布局过程 一.布局过程肯定要不可避免的涉及到layout()和onLayout()方法,这两个方法都是定义在View.java中,源码如下: /* ...
随机推荐
- Hadoop快速入门
目的 这篇文档的目的是帮助你快速完成单机上的Hadoop安装与使用以便你对Hadoop分布式文件系统(HDFS)和Map-Reduce框架有所体会,比如在HDFS上运行示例程序或简单作业等. 先决条件 ...
- ASP.NET MVC 自己实现登陆验证过滤器
1.首先添加一个过滤器类,并实现接口中对应的方法 public class YLFAuthorizeAttribute : FilterAttribute, IAuthorizationFilter ...
- WAMP启动失败简单解决方法
一般情况下,直接选择安装,突然出现问题了:提示:msvcp110.dll或msvcr110.dll问题, 那么你直接复制这个来百度就行. 在百度会提示让你一键安装并且修复的. 或者你可能会看网上其他教 ...
- sql是如何执行一个查询的!
引用自:http://rusanu.com/2013/08/01/understanding-how-sql-server-executes-a-query/ Understanding how SQ ...
- 【Junit】JUnit-4.12使用报java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing错误
下载了最新的JUnit版本,是4.12,结果尝试使用发现总是报java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing这样的错误, 上网查 ...
- uva.10020 Minimal coverage(贪心)
10020 Given several segments of line (int the X axis) with coordinates [Li, Ri]. You are to choose t ...
- IBM B16光纤交换机ZOON划分方法
一.ZOON的含义及划分原则 Zoon在光纤存储交换机中的功能类似于以太网交换机VLAN的作用,主要是为了在一台交换机划分出多个逻辑区,用于防范不同应用的存储连接发起广播包,提高光纤交换机 ...
- BZOJ1588——[HNOI2002]营业额统计
1.题目大意:一个简单的treap模板题(我才不告诉你题目少一句话呢,看discuss去 2.分析:treap模板题 #include <cstdio> #include <cstd ...
- polymorphic-associations 多态关联实例 ruby on rails
这次做新项目的时候,把图片都放在了一个表里,其他表中不再存图片信息,通过多态关联建立表之间的关系. (1)新建picture表, component表不需要处理 class CreatePicture ...
- C,C++经典笔试题(答案)转自:http://blog.163.com/jianhuali0118@126/blog/static/377499702008230104125229/
一.请填写BOOL , float, 指针变量 与“零值”比较的 if 语句.(10分) 请写出 BOOL flag 与“零值”比较的 if 语句.(3分) 标准答案: if ( fla ...