Android仿Iphone通知角标的实现(一)
来源:互联网 发布:淘宝花呗分期有利息吗 编辑:程序博客网 时间:2024/06/05 10:15
MainActivity如下:
package cc.testtipmessage2;import com.readystatesoftware.viewbadger.BadgeView;import android.os.Bundle;import android.widget.ImageView;import android.app.Activity;import android.graphics.Color;/** * Demo描述: * 仿Iphone通知角标的实现,借以提示用户有几条新的信息 * * 参考资料: * https://github.com/jgilfelt/android-viewbadger * http://blog.csdn.net/t12x3456/article/details/9337555 * Thank you very much */public class MainActivity extends Activity { private ImageView mImageView;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);init();} private void init(){ mImageView=(ImageView) findViewById(R.id.imageView); BadgeView badgeView = new BadgeView(MainActivity.this, mImageView);badgeView.setText("5");badgeView.setTextSize(8.5f);badgeView.setTextColor(Color.DKGRAY);badgeView.show();}}
main.xml如下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <ImageView android:id="@+id/imageView" android:layout_width="100dip" android:layout_height="100dip" android:background="@drawable/ic_launcher" android:layout_centerInParent="true" /></RelativeLayout>
- Android仿Iphone通知角标的实现(一)
- Android仿Iphone通知角标的实现
- Android仿Iphone通知角标的实现(二)
- android 仿iphone tab实现
- Android角标的实现 ,各品牌手机
- Android中ListView圆角实现,仿iPhone中UITableView
- Android 仿iphone提醒事项(一)
- Android 实现仿iphone下拉刷新列表
- android仿iPhone滚轮控件实现及源码分析(一)
- android仿iPhone滚轮控件实现及源码分析(一)
- android仿iPhone滚轮控件实现及源码分析(一)
- android仿iPhone滚轮控件实现及源码分析(一)
- Android 实现不同Launcher 桌面角标的坑(Badge)
- iPhone实现本地通知
- iPhone实现本地通知
- Android 仿闹钟 及 通知栏的实现
- Android仿iPhone圆角边框
- android实现 仿iphoneDialog实现类似于iphone对话框样式
- 使用Symfony2搭建电子商务网站总结
- websphere6.1集群的配置过程
- SSH中的jar包讲解(转)
- Line 全球用户达 2.3 亿,每天发送 70 亿条信息、10 亿张贴纸
- C# 中的委托和事件
- Android仿Iphone通知角标的实现(一)
- 网卡eth0,未发现连接设备Bringing up interface eth0: Error: No suitable device found: no device found for conne
- HDU夹角有多大II
- iPhone的Push(推送通知)功能原理浅析
- Java split函数备注
- Libcurl实现文件断点续传
- 关于Certificate、Provisioning Profile、App ID的介绍及其之间的关系
- AWK----awk与shell交互
- C语言深度解剖读书笔记(1.关键字的秘密)