lol盒子重點內容,lol盒子內容

來源:互聯網
上載者:User

lol盒子重點內容,lol盒子內容
//AFN函數 — imageview載入網狀圖片並且擷取圖片,擷取之後儲存到手機  [image setImageWithURLRequest:[NSURLRequestrequestWithURL:[NSURLURLWithString:[NSStringstringWithFormat:@"%@",skin.bigImg]] ] placeholderImage:nilsuccess:^(NSURLRequest*request, NSHTTPURLResponse *response, UIImage *image) {        UIImageWriteToSavedPhotosAlbum(image,self, @selector(image:didFinishSavingWithError:contextInfo:), nil);- (void)image:(UIImage*)image didFinishSavingWithError:(NSError*)error contextInfo:(void*)contextInfo
{
    if (error) {
        [selfshowToastWithText:@"不允許儲存"];
    }else{
        [selfshowToastWithText:@"儲存成功"];
    }}
_player = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:file] error:nil];
//            NSLog(@"%@",[NSURL fileURLWithPath:file]);
//            [_player play];
//audioplayer第三方類庫播放檔案
            AudioPlayer*player = [AudioPlayersharePlayer];            [player playWithDataSourceType:DataSourceTypeLocalwithURLString:file];
   //下載檔案
            NSString*string = [NSStringstringWithFormat:HERO_SOUND_DESC_URL,pathName,fileName];
            NSURL*url = [NSURLURLWithString:[stringstringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
            NSURLRequest*request = [NSURLRequestrequestWithURL:url];
           
            AFHTTPRequestOperation*operation = [[AFHTTPRequestOperationalloc]initWithRequest:request];
            operation.inputStream= [NSInputStreaminputStreamWithURL:url];
            operation.outputStream= [NSOutputStreamoutputStreamToFileAtPath:fileappend:NO];
            [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation*operation, id responseObject) {
                NSLog(@"下載成功");
                [_tableviewreloadData];
            } failure:^(AFHTTPRequestOperation*operation, NSError *error) {
                NSLog(@"下載失敗");
            }];            [operation start];//在停止滑動的時候將scrollview的縮放變為1倍-(void)scrollViewDidEndDecelerating:(UIScrollView*)scrollView
{    _pageIndex = scrollView.contentOffset.x/SCREEN_WIDTH;   
    for (UIScrollView*scrollview in scrollView.subviews)
    {
        if ([scrollview isKindOfClass:[UIScrollViewclass]]) {            [scrollview setZoomScale:1.0];        }
    }
    HeroSkin*skin = [_heroskinobjectAtIndex:_pageIndex];
    _namelabel.text= skin.name;
    _pricelabel.text= skin.price;
    _pagelabel.text= [NSStringstringWithFormat:@"%ld of %lu",_pageIndex+1,(unsignedlong)_heroskin.count];
    NSLog(@"%ld",(long)_pageIndex);}
//圖片搖動
-(void)ImageShake
{
    CABasicAnimation*basic = [CABasicAnimationanimationWithKeyPath:@"transform.rotation.z"];
    basic.fromValue= [NSNumbernumberWithFloat:-M_PI/16];
    basic.toValue= [NSNumbernumberWithFloat:M_PI/16];
    basic.duration= 0.1;
    basic.repeatCount= 3;    [imageview.layeraddAnimation:basic forKey:@"animateLayer"];//震動一次    AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);}
//檢測motion
-(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent*)event
{
    if (motion == UIEventSubtypeMotionShake) {
        [selfImageShake];
        [playerplay];
    }}
//計算string字串的frame大小
-(CGSize)getStringRect:(NSString*)str
{
    if (str.length<1) {
        returnCGSizeMake(0,0);
    }
    CGSize size;
    NSAttributedString*string = [[NSAttributedStringalloc]initWithString:str];
    //    NSDictionary *attribute= @{NSFontAttributeName:@12};
    size = [string boundingRectWithSize:CGSizeMake(280,500)options:NSStringDrawingTruncatesLastVisibleLine|
            NSStringDrawingUsesLineFragmentOrigin|
            NSStringDrawingUsesFontLeadingcontext:nil].size;
    return size;}
-(CGFloat)caculateLabelHeightWith:(float)fontsize String:(NSString*)str
{
    UIFont *font = [UIFontsystemFontOfSize:fontsize];
    CGSize size = CGSizeMake(300,700);
    CGSize descriptionSize = [str sizeWithFont:font constrainedToSize:size lineBreakMode:NSLineBreakByWordWrapping];
    return descriptionSize.height;}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.