模拟android toast
来源:互联网 发布:无人机遥控软件 编辑:程序博客网 时间:2024/05/22 15:16
-(void)showMessage:(NSString *)message
{
UIWindow * window = [UIApplicationsharedApplication].keyWindow;
UIView *showview = [[UIViewalloc]init];
showview.backgroundColor = [UIColorblackColor];
showview.frame =CGRectMake(1,1, 1,1);
showview.alpha =1.0f;
showview.layer.cornerRadius =5.0f;
showview.layer.masksToBounds =YES;
[window addSubview:showview];
UILabel *label = [[UILabelalloc]init];
CGSize LabelSize = [messagesizeWithFont:[UIFontsystemFontOfSize:17]constrainedToSize:CGSizeMake(290,9000)];
label.frame =CGRectMake(10,5, LabelSize.width, LabelSize.height);
label.text = message;
label.textColor = [UIColorwhiteColor];
label.textAlignment =1;
label.backgroundColor = [UIColorclearColor];
label.font = [UIFontboldSystemFontOfSize:15];
[showview addSubview:label];
showview.frame =CGRectMake(([UIScreenmainScreen].bounds.size.width- LabelSize.width - 20)/2, [UIScreenmainScreen].bounds.size.height-100, LabelSize.width+20, LabelSize.height+10);
[UIViewanimateWithDuration:2.0animations:^{
showview.alpha =0;
} completion:^(BOOL finished) {
[showview removeFromSuperview];
}];
}
- 模拟android toast
- Android通过Window获取View&模拟点击&自定义Toast
- Android-->Toast全屏和动画(模拟QQ样式)
- android Toast
- android Toast
- android Toast
- Android--Toast
- android Toast
- Android Toast
- android Toast
- Android Toast
- Android Toast
- android Toast
- android Toast
- Android Toast
- android toast
- Android Toast
- Android-Toast
- 手机端简单js拖拽效果
- 关于在eclipse或myeclipse安装Find bugs插件的操作
- 策略模式
- source insight回车换行{}对齐
- MyEclipse2014安装freemarker插件
- 模拟android toast
- Python快速入门2--数据结构
- 数据库读写分离的简单思路
- 安装Android模拟器
- VB关于Winsock的State属性的值
- arm-linux-系列工具介绍
- java调用exec【hello world】
- R语言基本语法(R语言学习二)
- Markdown