日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
利用uitouch簡單的實現(xiàn)了微信cell效果-創(chuàng)新互聯(lián)

#import

成都服務器托管,創(chuàng)新互聯(lián)提供包括服務器租用、雅安電信機房、帶寬租用、云主機、機柜租用、主機租用托管、CDN網(wǎng)站加速、主機域名等業(yè)務的一體化完整服務。電話咨詢:028-86922220

@interface weixinControl : UIControl

-(weixinControl *)initWithFram:(CGRect)rect;

@end

#import "weixinControl.h"

@implementation weixinControl

{

  CGRect _rect; //記錄self.frame的大小

  UIView *_frontView; //用來顯示主要內容

  CGPoint _originPoint; //記錄開始touch時的position

  CGPoint _currentPoint;//記錄當前位置

  CGRect _frontViewOriginRect;//記錄frontVie的初始fram

  CGFloat _offsetXPosition; //記錄x的位移量

  UIButton *_delBtn; //刪除按鈕

}

-(weixinControl *)initWithFram:(CGRect)rect

{

  if (self = [super initWithFrame:rect]) {

    self.backgroundColor = [UIColor cyanColor];

    _rect = rect;

    _offsetXPosition = 0.0f;

    [self makeDeletButton];

    [self makeFrontView];

  }

  return self;

}

-(void)makeDeletButton

{

  _delBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];

  _delBtn.frame = CGRectMake(_rect.size.width - 50, 0, 50, _rect.size.height);

  [_delBtn setTitle:@"刪除" forState:UIControlStateNormal];

  _delBtn.backgroundColor = [UIColor redColor];

  [self addSubview:_delBtn];

}

-(void)makeFrontView

{

  _frontView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, _rect.size.width, _rect.size.height)];

  _frontViewOriginRect = _frontView.frame;

  _frontView.backgroundColor = [UIColor blueColor];

  [self addSubview:_frontView];

}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

{

  UITouch *beganTouch = [touches anyObject];

  _originPoint = [beganTouch locationInView:self];

}

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

{

  if (_offsetXPosition < (0 - _delBtn.frame.size.width)) {

    _frontView.frame = CGRectMake((0 -_delBtn.frame.size.width), _frontViewOriginRect.origin.y, _frontViewOriginRect.size.width, _frontViewOriginRect.size.height);

  }

  else

  {

    _frontView.frame = _frontViewOriginRect;

  }

}

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event

{

  UITouch *moveTouch = [touches anyObject];

  _currentPoint = [moveTouch locationInView:self];

  _offsetXPosition = _currentPoint.x - _originPoint.x;

  if (_offsetXPosition >= 0) {

    return;

  }

  _frontView.frame = CGRectMake(_offsetXPosition, _frontViewOriginRect.origin.y, _frontViewOriginRect.size.width, _frontViewOriginRect.size.height);

}

@end

另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。


網(wǎng)站題目:利用uitouch簡單的實現(xiàn)了微信cell效果-創(chuàng)新互聯(lián)
網(wǎng)頁鏈接:http://www.dlmjj.cn/article/gicog.html