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

            精品少妇人妻av无码久久| 中文字幕人妻色偷偷久久| 久久久综合九色合综国产| 久久只有这精品99| 久久精品国内一区二区三区| 亚洲人成无码www久久久| 久久成人影院精品777| 丰满少妇人妻久久久久久| 亚洲av伊人久久综合密臀性色| 久久午夜福利电影| 亚洲国产成人精品女人久久久 | 91久久精品国产免费直播| 精品久久久久久亚洲精品| 狠狠综合久久综合中文88| 色天使久久综合网天天| 精品久久久久久久| 热re99久久精品国99热| 无码人妻久久久一区二区三区| 伊人伊成久久人综合网777| 色婷婷久久久SWAG精品| 91精品国产高清久久久久久io | 999久久久免费精品国产| 91亚洲国产成人久久精品网址| 亚洲国产天堂久久久久久| 美女写真久久影院| 久久99精品国产麻豆| 国内精品人妻无码久久久影院导航| 久久精品嫩草影院| 中文字幕久久欲求不满| 精品久久久久久无码专区| 亚洲日本va中文字幕久久| 亚洲国产一成久久精品国产成人综合| 99久久99这里只有免费费精品| 人妻精品久久无码专区精东影业| 久久久av波多野一区二区| 久久久久久国产精品免费无码| 热久久国产精品| 久久综合色区| 国产精品美女久久久久久2018 | 久久久久久久免费视频| 欧美一区二区三区久久综|