• <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 © 冷鋒

            一级做a爰片久久毛片毛片| 久久久久久人妻无码| 久久国产精品波多野结衣AV| 国产成人久久精品二区三区| 久久久久久国产a免费观看不卡| 午夜精品久久久内射近拍高清| 蜜桃麻豆WWW久久囤产精品| 精品免费久久久久久久| 久久精品亚洲精品国产欧美| 中文精品久久久久人妻不卡| 亚洲国产成人久久精品动漫| 亚洲午夜久久久影院伊人| 久久综合欧美成人| 婷婷综合久久中文字幕蜜桃三电影 | 人妻丰满AV无码久久不卡| 久久国产成人午夜AV影院| 精品久久8x国产免费观看| 亚洲精品乱码久久久久久蜜桃| 亚洲国产精品久久66| 色88久久久久高潮综合影院 | 国产亚洲欧美精品久久久| 无码乱码观看精品久久| 久久免费国产精品一区二区| 精品国产VA久久久久久久冰| 囯产精品久久久久久久久蜜桃 | 久久亚洲欧美国产精品| 一97日本道伊人久久综合影院| 国产精品成人99久久久久 | 久久棈精品久久久久久噜噜| 人妻无码精品久久亚瑟影视| 国内精品伊人久久久久影院对白 | 久久精品国产精品亜洲毛片| 久久免费线看线看| 国产一级做a爰片久久毛片| 久久男人Av资源网站无码软件| 亚洲AV日韩AV永久无码久久| 久久精品国产色蜜蜜麻豆| 影音先锋女人AV鲁色资源网久久 | 久久久久久久精品成人热色戒| 亚洲午夜精品久久久久久浪潮 | 久久中文字幕人妻丝袜|