• <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)庫工程,不可能自己弄張圖上去,不然使用本庫的時(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 © 冷鋒

            久久99精品免费一区二区| 国产成人精品久久综合| 国产叼嘿久久精品久久| 亚洲国产成人乱码精品女人久久久不卡 | 日本精品久久久久中文字幕8| 久久99国产精品久久久| 久久99久久成人免费播放| 久久亚洲熟女cc98cm| 青青草国产成人久久91网| 久久成人小视频| 91精品婷婷国产综合久久| 精品伊人久久大线蕉色首页| 久久精品国产精品国产精品污| 亚洲美日韩Av中文字幕无码久久久妻妇| 久久伊人精品青青草原日本| 久久伊人精品青青草原高清| 久久93精品国产91久久综合| 日产精品99久久久久久| 久久免费99精品国产自在现线| 久久精品一本到99热免费| 亚洲国产精品久久久久婷婷老年 | 国内精品久久久久久久97牛牛| 99久久www免费人成精品 | 人妻精品久久无码区| 青青草原综合久久大伊人导航| 久久99国产精品二区不卡| 国产精品对白刺激久久久| 国产精品亚洲综合久久| 婷婷久久精品国产| 久久精品夜色噜噜亚洲A∨| 91久久精品国产成人久久| 狠狠狠色丁香婷婷综合久久五月| 一本色道久久88综合日韩精品| 久久九九青青国产精品| 狠狠色丁香婷婷综合久久来| 久久国产色av免费看| 国内精品九九久久精品| 7777久久久国产精品消防器材| 久久人人爽人人人人爽AV| 久久精品国产亚洲AV香蕉| 影音先锋女人AV鲁色资源网久久|