iOS 菊花效果
来源:互联网 发布:如何代销淘宝产品 编辑:程序博客网 时间:2024/04/28 15:21
先下载第三方MBProgressHUD并且引入MBProgressHUD.和MBProgressHUD.m:
// RootViewController.m
// MBProgressDemo
//
// Created by Dubai on 15/4/13.
// Copyright (c) 2015年 Dubai. All rights reserved.
//
#import "RootViewController.h"
#import "MBProgressHUD.h"
#import "SecondViewController.h"//第二个页面
@interface RootViewController ()<MBProgressHUDDelegate>
@property (strong,nonatomic) UIButton *changeBtn;//改变颜色
@property (strong,nonatomic) UIButton *playBtn;//能否有交互
@property (strong,nonatomic) UILabel *labelOne;
@end
@implementation RootViewController
- (void)viewDidLoad {
[superviewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColorwhiteColor];
self.changeBtn = [UIButtonbuttonWithType:(UIButtonTypeSystem)];
self.changeBtn.frame =CGRectMake(60,100, 60, 40);
[self.changeBtnsetTitle:@"改变"forState:(UIControlStateNormal)];
[self.changeBtnaddTarget:selfaction:@selector(didChangeBtnActionL:)forControlEvents:(UIControlEventTouchUpInside)];
[self.viewaddSubview:self.changeBtn];
self.labelOne = [[UILabelalloc] initWithFrame:CGRectMake(60,400, 60, 40)];
self.labelOne.text =@"hello";
[self.viewaddSubview:self.labelOne];
self.playBtn = [UIButtonbuttonWithType:(UIButtonTypeSystem)];
self.playBtn.frame =CGRectMake(100,300, 60, 40);
[self.playBtnsetTitle:@"123"forState:(UIControlStateNormal)];
[self.playBtnaddTarget:selfaction:@selector(didplayBrtn)forControlEvents:(UIControlEventTouchUpInside)];
[self.viewaddSubview:self.playBtn];
}
- (void)didChangeBtnActionL:(UIButton *)sender
{
// _HUD = [[MBProgressHUD alloc] initWithFrame:CGRectMake(60, 100, 60, 60)];
// [self.view addSubview:_HUD];
//
// // Set the hud to display with a color
// _HUD.color = [UIColor colorWithRed:0.23 green:0.50 blue:0.82 alpha:0.90];
//
// _HUD.delegate = self;
// [_HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
//
_HUD = [[MBProgressHUDalloc] initWithFrame:CGRectMake(60,100, 60, 60)];
[self.viewaddSubview:_HUD];
_HUD.dimBackground =YES;
// Regiser for HUD callbacks so we can remove it from the window at the right time
_HUD.delegate =self;
// Show the HUD while the provided method executes in a new thread
[_HUDshowWhileExecuting:@selector(myTask)onTarget:selfwithObject:nilanimated:YES];
}
- (void)myTask
{
sleep(3);
}
- (void)didplayBrtn
{
NSLog(@"heloo1");
SecondViewController *secondVC = [[SecondViewControlleralloc] init];
[self.navigationControllerpushViewController:secondVC animated:YES];
}
- (void)didReceiveMemoryWarning {
[superdidReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
- iOS 菊花效果
- 仿IOS等待菊花效果
- iOS AFNetworkActivityIndicatorManager 状态栏上边的菊花效果
- 指示器(菊花效果)代码演示--iOS开发
- 页面菊花效果
- css菊花加载效果
- iOS 小菊花
- Android Progressbar自定义菊花效果
- ios弹菊花和推荐
- IOS 菊花弹窗提示
- 状态栏的菊花 iOS
- android仿ios菊花LoadingView
- 菊花
- 菊花
- Android 自定义加载view(菊花效果)
- iOS UIActivityIndicatorView 的使用(菊花)
- iOS UIActivityIndicatorView 的使用(旋转菊花)
- iOS UIActivityIndicatorView用法(菊花旋转)
- Eclipse/Myeclipse开发实用快捷键收集
- Java集合Map接口与Map.Entry学习
- 二叉树的遍历 递归非递归 思路和 java实现
- spring+hibernate_hibernateTemplate+数据优化
- js面向对象
- iOS 菊花效果
- 解决xcode插件升级失效的命令
- ASP.NET页面运行机制以及请求处理流程
- 数据结构:堆栈的链式存储实现
- Maven 之初学笔记(一)
- spring+hibernate_hibernateTemplate
- SQLServer从mdf和ldb还原数据库
- Keychain数据导出
- Android Fresco图片处理库用法API英文原文文档1(Facebook开源Android图片库)