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

            国内精品人妻无码久久久影院导航| 99久久免费国产精品特黄| 亚洲国产成人久久一区WWW| 久久综合九色综合久99| www.久久热.com| 亚洲国产天堂久久综合网站| 久久er国产精品免费观看2| 成人综合伊人五月婷久久| 国产精品女同久久久久电影院 | 精品无码久久久久久久久久| 久久精品国产99国产精品澳门| 精品国产一区二区三区久久久狼| 国产精品一区二区久久国产| 亚洲精品高清久久| 久久亚洲天堂| 伊人久久综合成人网| 好久久免费视频高清| 久久久91人妻无码精品蜜桃HD| 久久亚洲国产成人精品无码区| 亚洲精品NV久久久久久久久久| 一本色道久久88—综合亚洲精品| 天堂久久天堂AV色综合| 国产成人精品久久一区二区三区| 久久www免费人成看国产片 | 中文字幕无码久久久| 无码精品久久久久久人妻中字 | 久久99精品综合国产首页| 国产精品99久久精品爆乳| 一个色综合久久| 久久久久久综合一区中文字幕| 狠狠精品干练久久久无码中文字幕 | 久久精品国产99久久无毒不卡 | 亚洲中文字幕无码久久综合网| 国产精品一久久香蕉国产线看观看| 精品久久久久久久久久中文字幕| 欧美国产成人久久精品| AAA级久久久精品无码区| 亚洲女久久久噜噜噜熟女| 久久国产V一级毛多内射| 日韩精品久久久肉伦网站 | 久久99精品久久久久久噜噜 |