• <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)打開(kāi)網(wǎng)頁(yè)的功能,寫工具條的時(shí)候發(fā)現(xiàn)系統(tǒng)圖標(biāo)里面竟然沒(méi)有后退按鈕,,由于我這個(gè)是靜態(tài)庫(kù)工程,不可能自己弄張圖上去,不然使用本庫(kù)的時(shí)候還得附上圖片,經(jīng)過(guò)一下午的搜索,終于找到個(gè)比較靠譜的,這哥們硬是用代碼給畫出來(lái)個(gè)箭頭了(話說(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 © 冷鋒

            日韩欧美亚洲综合久久| 日本一区精品久久久久影院| 久久97久久97精品免视看| 中文精品久久久久国产网址| 精品无码久久久久久国产| 欧美精品国产综合久久| 91精品国产高清久久久久久io| 久久天堂电影网| 三级韩国一区久久二区综合 | 嫩草影院久久国产精品| 久久精品亚洲欧美日韩久久| 性色欲网站人妻丰满中文久久不卡| 99国产欧美精品久久久蜜芽 | 国内精品久久久久久中文字幕| 一级做a爰片久久毛片免费陪| 国产精品久久久久AV福利动漫| 久久亚洲2019中文字幕| 国内精品人妻无码久久久影院| 亚洲国产日韩欧美综合久久| 国产精品久久久久影院色| 久久久久波多野结衣高潮| 久久精品综合一区二区三区| 精品久久久久久无码专区| 久久天天躁狠狠躁夜夜2020一 | 色综合久久精品中文字幕首页| 亚洲AV日韩AV天堂久久| 国内精品人妻无码久久久影院导航 | 精品久久久久国产免费| A狠狠久久蜜臀婷色中文网| 亚洲色欲久久久综合网东京热| 国内精品久久久久久久coent| 国产精品久久久久久影院| 久久国产精品77777| 亚洲色欲久久久综合网| 午夜精品久久久久久毛片| 99久久精品国产一区二区| 久久久久久国产精品无码下载| 麻豆久久久9性大片| 久久伊人精品一区二区三区| 国产免费久久精品99re丫y| 国产99久久久国产精品小说|