• <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>
            今天在寫(xiě)程序內(nèi)打開(kāi)網(wǎng)頁(yè)的功能,寫(xiě)工具條的時(shí)候發(fā)現(xiàn)系統(tǒng)圖標(biāo)里面竟然沒(méi)有后退按鈕,,由于我這個(gè)是靜態(tài)庫(kù)工程,不可能自己弄張圖上去,不然使用本庫(kù)的時(shí)候還得附上圖片,經(jīng)過(guò)一下午的搜索,終于找到個(gè)比較靠譜的,這哥們硬是用代碼給畫(huà)出來(lái)個(gè)箭頭了(話(huà)說(shuō)如果是其他不規(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无码久久| 久久综合久久伊人| 久久久久se色偷偷亚洲精品av | 久久91精品久久91综合| 国产精品久久久久乳精品爆| 精品久久久无码21p发布 | 99久久国产主播综合精品| 伊人久久大香线蕉成人| 久久精品国产影库免费看| 狠狠色狠狠色综合久久| 精品久久人人做人人爽综合| 色8久久人人97超碰香蕉987| 久久精品这里只有精99品| 99久久中文字幕| 久久亚洲国产最新网站| 国产高潮国产高潮久久久91| 国产精品美女久久久久久2018| 欧美日韩精品久久久久| 国产精品美女久久久久av爽 | 久久精品国产亚洲AV忘忧草18| 久久久综合九色合综国产| 亚洲精品国产字幕久久不卡| 色综合合久久天天给综看| 久久国产乱子伦精品免费午夜| 久久九九亚洲精品| 国产精品久久久久久久久鸭| 香蕉久久av一区二区三区| 99久久99久久精品国产片果冻| 国产精品亚洲综合久久| 久久中文字幕人妻丝袜| 思思久久精品在热线热| 亚洲国产一成久久精品国产成人综合| 亚洲国产精品一区二区久久| 国产精品久久国产精麻豆99网站| 婷婷伊人久久大香线蕉AV | 亚洲国产精品无码成人片久久| 国产69精品久久久久APP下载| 伊人久久成人成综合网222| 久久免费视频1| 色欲综合久久躁天天躁蜜桃|