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

            欧美午夜精品久久久久久浪潮| 伊人久久成人成综合网222| 国产激情久久久久影院老熟女免费| 精品免费tv久久久久久久| 国产精品欧美亚洲韩国日本久久 | 欧美午夜精品久久久久免费视| 日日噜噜夜夜狠狠久久丁香五月| 亚洲国产精品无码久久久蜜芽| 久久精品夜色噜噜亚洲A∨| 久久精品国产亚洲AV麻豆网站| 久久久久女教师免费一区| 伊人久久大香线蕉成人| 色综合久久88色综合天天| 亚洲精品白浆高清久久久久久| 久久91亚洲人成电影网站| 国产精品成人久久久| 精品国产热久久久福利| 久久久久亚洲AV无码永不| 国产高清国内精品福利99久久| 久久无码AV一区二区三区| 久久99亚洲网美利坚合众国| 久久久久se色偷偷亚洲精品av| 国内精品久久九九国产精品| 久久亚洲中文字幕精品一区| 久久久久国产视频电影| 国产精品久久久久影视不卡 | 亚洲中文字幕无码久久2017| 亚洲国产成人久久精品99| 国内精品久久久久久99| 久久亚洲国产成人影院| 欧美性大战久久久久久| 国产精品gz久久久| 久久福利青草精品资源站免费| 2021少妇久久久久久久久久| 国产精品美女久久久免费| 国产精品一区二区久久国产| 伊人久久大香线蕉综合Av| 久久天天躁夜夜躁狠狠躁2022| 99热都是精品久久久久久| 亚洲狠狠久久综合一区77777| 国产精品久久久久久福利69堂|