118 lines
3.4 KiB
Objective-C
118 lines
3.4 KiB
Objective-C
//
|
|
// IfishConnectingView.m
|
|
// Ifish
|
|
//
|
|
// Created by imac on 16/10/31.
|
|
// Copyright © 2016年 lianxiang. All rights reserved.
|
|
//
|
|
|
|
#import "IfishConnectingView.h"
|
|
#import "GYChangeTextView.h"
|
|
#import "FBShimmeringView.h"
|
|
|
|
@implementation IfishConnectingView
|
|
|
|
-(id)initWithFrame:(CGRect)frame{
|
|
|
|
self = [super initWithFrame:frame];
|
|
if (self) {
|
|
// Initialization code
|
|
|
|
[self setUpVewsWithframe:frame];
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
-(void)setUpVewsWithframe:(CGRect)frame
|
|
{
|
|
CGFloat percentWH = 0.14;//6p 64/414
|
|
|
|
CGFloat ImgW =frame.size.width*percentWH;
|
|
|
|
self.fishImageView = [[UIImageView alloc] initWithFrame:CGRectMake(frame.size.width/2 - ImgW/2,10,ImgW, ImgW)];
|
|
self.fishImageView.image = [UIImage imageNamed:@"linkingdevice_logo"];
|
|
|
|
[self addSubview:self.fishImageView];
|
|
|
|
GYChangeTextView *tView = [[GYChangeTextView alloc] initWithFrame:CGRectMake(0,CGRectGetMaxY(self.fishImageView.frame)+10,frame.size.width, 30)];
|
|
|
|
tView.delegate = self;
|
|
//tView.layer.borderWidth = 1.0; /*为了看的清楚加个边*/
|
|
//tView.layer.borderColor = [UIColor blackColor].CGColor;
|
|
|
|
[self addSubview:tView];
|
|
self.textChangeView = tView;
|
|
|
|
|
|
// [self.textChangeView startAnimation];
|
|
|
|
//1pexView
|
|
self.lineView=[[UIImageView alloc] initWithFrame:CGRectMake(20 ,CGRectGetMaxY(self.textChangeView.frame) + 5,frame.size.width - 20*2,1)];
|
|
self.lineView.image = [UIImage imageNamed:@"linkingdevice_line"];
|
|
[self addSubview:self.lineView];
|
|
|
|
[self setShimmigViewfishImage:self.fishImageView];
|
|
|
|
[self setShimmigViewlineView:self.lineView];
|
|
|
|
|
|
}
|
|
|
|
-(void)setShimmigViewfishImage:(UIImageView *)shimmView
|
|
{
|
|
FBShimmeringView *shimmeringView = [[FBShimmeringView alloc] initWithFrame:shimmView.frame];
|
|
shimmeringView.shimmering = YES;
|
|
shimmeringView.shimmeringOpacity = 1;
|
|
shimmeringView.shimmeringAnimationOpacity = 0.3;
|
|
|
|
shimmeringView.shimmeringDirection = FBShimmerDirectionRight;
|
|
|
|
//self.shimmeringView.shimmeringBeginFadeDuration = 1;
|
|
shimmeringView.shimmeringPauseDuration = 0.8;
|
|
shimmeringView.shimmeringHighlightLength = 0.8;
|
|
shimmeringView.shimmeringHighlightWidth = 0.8;
|
|
|
|
shimmeringView.shimmeringSpeed = 100;
|
|
|
|
//self.shimmeringView.backgroundColor = [UIColor whiteColor];
|
|
//self.shimmeringView.clipsToBounds = YES;
|
|
|
|
[self addSubview:shimmeringView];
|
|
shimmeringView.contentView = shimmView;
|
|
|
|
}
|
|
|
|
-(void)setShimmigViewlineView:(UIImageView *)shimmView
|
|
{
|
|
FBShimmeringView *shimmeringView = [[FBShimmeringView alloc] initWithFrame:shimmView.frame];
|
|
shimmeringView.shimmering = YES;
|
|
shimmeringView.shimmeringOpacity = 1;
|
|
shimmeringView.shimmeringAnimationOpacity = 0.7;
|
|
|
|
shimmeringView.shimmeringDirection = FBShimmerDirectionRight;
|
|
|
|
//self.shimmeringView.shimmeringBeginFadeDuration = 1;
|
|
shimmeringView.shimmeringPauseDuration = 0.8;
|
|
shimmeringView.shimmeringHighlightLength = 0.5;
|
|
shimmeringView.shimmeringHighlightWidth = 0.5;
|
|
|
|
shimmeringView.shimmeringSpeed = 100;
|
|
|
|
//self.shimmeringView.backgroundColor = [UIColor whiteColor];
|
|
//self.shimmeringView.clipsToBounds = YES;
|
|
|
|
[self addSubview:shimmeringView];
|
|
shimmeringView.contentView = shimmView;
|
|
}
|
|
|
|
- (void)gyChangeTextView:(GYChangeTextView *)textView didTapedAtIndex:(NSInteger)index {
|
|
NSLog(@"index%ld",index);
|
|
}
|
|
|
|
|
|
@end
|