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

            色偷偷久久一区二区三区| 色综合久久久久网| 久久精品国产99国产精品亚洲| 色综合久久中文字幕无码| 久久精品国产91久久麻豆自制 | 99久久99这里只有免费费精品 | 欧美与黑人午夜性猛交久久久| 一本大道久久香蕉成人网| 久久久久久亚洲Av无码精品专口| 久久99久久99小草精品免视看| 欧美成a人片免费看久久| 国产精品一区二区久久精品| 久久亚洲精品无码VA大香大香| 99久久精品免费看国产一区二区三区 | 狠狠色丁香婷婷久久综合不卡| 久久无码人妻精品一区二区三区 | 国产一区二区精品久久凹凸| 少妇人妻88久久中文字幕| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区 | 久久久国产精品| 久久青青草原国产精品免费| 蜜臀av性久久久久蜜臀aⅴ麻豆| 久久综合九色综合欧美就去吻 | 亚洲精品国产字幕久久不卡| 四虎影视久久久免费| 国产精品九九久久免费视频 | 欧美精品一区二区久久| 天天爽天天爽天天片a久久网| 久久精品国产亚洲AV电影| 亚洲精品无码久久久久久| 亚洲精品国产综合久久一线| 色婷婷久久久SWAG精品| 亚洲午夜精品久久久久久app| 亚洲乱码日产精品a级毛片久久| 日韩十八禁一区二区久久| 欧美一区二区久久精品| 久久婷婷午色综合夜啪| 思思久久99热只有频精品66| 热99RE久久精品这里都是精品免费| 欧美与黑人午夜性猛交久久久 | 久久福利青草精品资源站|