Fetal echocardiogr
This application r
Sidney Mier
Sidne
OAKLAND, Calif. –
In vitro and in vi
Golf at Augusta Na
Q:
CakePHP: The v
/*
This file is
This is an archive//
// YJDemo1View.m
// YJDemo1
//
// Created by MiaoJiuShi on 2017/4/11.
// Copyright © 2017年 深圳市哎吖科技有限公司. All rights reserved.
//
#import "YJDemo1View.h"
@interface YJDemo1View ()
@property (weak, nonatomic) IBOutlet UIImageView *tipsView;
@property (weak, nonatomic) IBOutlet UIImageView *bannerView;
@property (weak, nonatomic) IBOutlet UIButton *refreshButton;
@property (nonatomic, weak) UIButton *refreshItem;
@property (nonatomic, weak) UIActivityIndicatorView *activityIndicator;
@property (nonatomic, weak) NSTimer *timer;
@end
@implementation YJDemo1View
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.title = @"视频";
self.view.backgroundColor = [UIColor whiteColor];
// 获取image参数
self.refreshItem = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 100, 150)];
self.refreshItem.center = self.view.center;
[self.refreshItem setImage:[UIImage imageNamed:@"YJDemo1"] forState:UIControlStateNormal];
[self.refreshItem setImage:[UIImage imageNamed:@"YJDemo1"] forState:UIControlStateHighlighted];
[self.refreshItem setBackgroundColor:[UIColor clearColor]];
self.refreshItem.titleLabel.textAlignment = NSTextAlignmentCenter;
[self.refreshItem addTarget:self action:@selector(refreshClick) forControlEvents:UIControlEventTouchUpInside];
self.refreshItem.alpha = 1;
self.refreshItem.hidden = YES;
// 获取activity的frame
self.activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
self.activityIndicator.frame = CGRectMake(0, 0, 40, 40);
[self.activityIndicator startAnimating];
[self addSubview:self.refreshItem];
[self addSubview:self.activityIndicator];
}
- (IBAction)refreshClick {
if (self.refreshItem.selected == NO) {
[self.refreshItem setSelected:YES];
}else{
[self.refreshItem setSelected:NO];
}
[self.timer invalidate];
self.timer = nil;
if (self.refreshItem.selected == NO) {
[self.activityIndicator stopAnimating];
[self.activityIndicator removeFromSuperview];
self.activityIndicator = nil;
}else{
[self.activityIndicator startAnimating];
self.activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
self.activityIndicator.frame = CGRectMake(0, 0, 40, 40);
[self.activityIndicator startAnimating];
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// 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