• <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)頁的功能,寫工具條的時候發(fā)現(xiàn)系統(tǒng)圖標(biāo)里面竟然沒有后退按鈕,,由于我這個是靜態(tài)庫工程,不可能自己弄張圖上去,不然使用本庫的時候還得附上圖片,經(jīng)過一下午的搜索,終于找到個比較靠譜的,這哥們硬是用代碼給畫出來個箭頭了(話說如果是其他不規(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久久久久| 狠狠色综合网站久久久久久久高清| 久久精品国产99久久久| 久久国产精品波多野结衣AV| 亚洲欧美日韩中文久久 | 精品久久人人爽天天玩人人妻| 久久黄色视频| 国产精品久久成人影院| 人人狠狠综合久久亚洲高清| 2022年国产精品久久久久| 亚洲精品NV久久久久久久久久| 精品免费久久久久久久| 久久久久亚洲AV无码专区首JN| 51久久夜色精品国产| 国产精品女同久久久久电影院| 亚洲v国产v天堂a无码久久| 久久免费小视频| 久久久久亚洲Av无码专| 久久久久久久波多野结衣高潮| 久久久久一本毛久久久| 久久九九青青国产精品| 99久久国产综合精品麻豆| 亚洲精品美女久久777777| 亚洲日本va午夜中文字幕久久| 国产91久久综合| 九九热久久免费视频| 国产成人无码精品久久久久免费| 久久偷看各类wc女厕嘘嘘| 久久一日本道色综合久久| 久久精品国产亚洲AV影院 | 久久A级毛片免费观看| 久久精品国产日本波多野结衣| 一级A毛片免费观看久久精品| 婷婷久久综合九色综合九七| 久久久久亚洲AV成人网| 国产日韩久久免费影院| 久久久久久久久久免免费精品|