• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            今天在寫程序內(nèi)打開網(wǎng)頁的功能,寫工具條的時(shí)候發(fā)現(xiàn)系統(tǒng)圖標(biāo)里面竟然沒有后退按鈕,,由于我這個(gè)是靜態(tài)庫(kù)工程,不可能自己弄張圖上去,不然使用本庫(kù)的時(shí)候還得附上圖片,經(jīng)過一下午的搜索,終于找到個(gè)比較靠譜的,這哥們硬是用代碼給畫出來個(gè)箭頭了(話說如果是其他不規(guī)則的圖形要咋辦呢?),還是google管用啊,baidu非常非常非常。。。垃圾。

            Code Example: Drawing the iPhone Back Button(轉(zhuǎn)載)

            Recently, I had need to provide a back button similar to the one used in Mobile Safari for a consulting project.

            Many of the buttons used in the built-in iPhone applications are made available via the SDK with built in button types and graphics. Unfortunately, the back button is not one of these.

            Because I needed to display the toolbar button from inside a static library which can not include images, I had to render the back arrow directly in code.

            Since this was a bit time consuming, I thought I would share in hopes that it saves someone else a little bit of time.

            - (CGContextRef)createContext
            {
            // create the bitmap context
            CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
            CGContextRef context = CGBitmapContextCreate(nil,27,27,8,0,
            colorSpace,kCGImageAlphaPremultipliedLast);
            CFRelease(colorSpace);
            return context;
            }
            - (CGImageRef)createBackArrowImageRef
            {
            CGContextRef context = [self createContext];
            // set the fill color
            CGColorRef fillColor = [[UIColor blackColor] CGColor];
            CGContextSetFillColor(context, CGColorGetComponents(fillColor));
            CGContextBeginPath(context);
            CGContextMoveToPoint(context, 8.0f, 13.0f);
            CGContextAddLineToPoint(context, 24.0f, 4.0f);
            CGContextAddLineToPoint(context, 24.0f, 22.0f);
            CGContextClosePath(context);
            CGContextFillPath(context);
            // convert the context into a CGImageRef
            CGImageRef image = CGBitmapContextCreateImage(context);
            CGContextRelease(context);
            return image;
            }
            - (UIBarButtonItem *)backButton
            {
            CGImageRef theCGImage = [self createBackArrowImageRef];
            UIImage *backImage = [[UIImage alloc] initWithCGImage:theCGImage];
            CGImageRelease(theCGImage);
            UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:backImage
            style:UIBarButtonItemStylePlain
            target:self.webView
            action:@selector(goBack)];
            [backImage release], backImage = nil;
            return [backButton autorelease];
            }

            posts - 15, comments - 18, trackbacks - 0, articles - 0

            Copyright © 冷鋒

            久久AV无码精品人妻糸列| 色婷婷久久久SWAG精品| 久久久老熟女一区二区三区| 无码人妻久久一区二区三区蜜桃| 亚洲精品97久久中文字幕无码| 久久亚洲sm情趣捆绑调教| 日产精品久久久一区二区| 久久午夜电影网| 少妇久久久久久被弄到高潮| 日本人妻丰满熟妇久久久久久| 亚洲成人精品久久| 伊人久久大香线蕉成人| 国产精品久久毛片完整版| 少妇被又大又粗又爽毛片久久黑人| 狼狼综合久久久久综合网| 久久青青国产| 国产精品一区二区久久国产| 久久无码人妻精品一区二区三区| 久久精品亚洲日本波多野结衣| 少妇久久久久久被弄到高潮| 国产精品久久国产精品99盘| 日韩精品久久久久久久电影| 精品久久久久中文字| 久久99久久99小草精品免视看| 久久久久亚洲AV成人网人人网站| 久久精品成人免费观看97| 久久91精品国产91久久麻豆| 97精品伊人久久久大香线蕉 | 久久久久亚洲Av无码专| 久久亚洲欧洲国产综合| 国产福利电影一区二区三区久久老子无码午夜伦不 | 久久精品亚洲精品国产欧美| 久久精品99久久香蕉国产色戒| 精品久久久无码21p发布| 人妻少妇精品久久| 久久精品免费网站网| 99久久国产主播综合精品| 久久精品国产亚洲综合色| 国产欧美久久一区二区| 99精品久久精品一区二区| 91精品国产高清久久久久久io|