• <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>

            UIWebView加上safari風格前進后退按鈕

            Posted on 2011-06-02 22:46 冷鋒 閱讀(3833) 評論(0)  編輯 收藏 引用 所屬分類: IOS開發
            今天在寫程序內打開網頁的功能,寫工具條的時候發現系統圖標里面竟然沒有后退按鈕,,由于我這個是靜態庫工程,不可能自己弄張圖上去,不然使用本庫的時候還得附上圖片,經過一下午的搜索,終于找到個比較靠譜的,這哥們硬是用代碼給畫出來個箭頭了(話說如果是其他不規則的圖形要咋辦呢?),還是google管用啊,baidu非常非常非常。。。垃圾。

            Code Example: Drawing the iPhone Back Button(轉載)

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

            久久中文骚妇内射| 性欧美大战久久久久久久| 久久久久女人精品毛片| 韩国免费A级毛片久久| 青青青青久久精品国产h| 亚洲人AV永久一区二区三区久久| 午夜久久久久久禁播电影| 久久久久亚洲av成人无码电影| 色婷婷综合久久久久中文一区二区 | 色婷婷综合久久久中文字幕| 久久久WWW成人免费精品| 一本色道久久88精品综合| 国产精品99久久久久久宅男| 久久精品卫校国产小美女| 国产精品无码久久综合网| 国产精品久久久久…| 久久久久久久人妻无码中文字幕爆 | 久久精品国产亚洲AV嫖农村妇女 | 久久精品女人天堂AV麻| 久久精品国产网红主播| 日韩精品久久久久久免费| 香蕉99久久国产综合精品宅男自| 国产精品久久成人影院| 国产V亚洲V天堂无码久久久| 香蕉久久av一区二区三区| 模特私拍国产精品久久| 午夜视频久久久久一区 | 精品人妻伦九区久久AAA片69| 亚洲&#228;v永久无码精品天堂久久 | 国产精品久久亚洲不卡动漫| 亚洲国产另类久久久精品| av色综合久久天堂av色综合在| 欧美一级久久久久久久大片| 亚洲国产精品一区二区三区久久 | 久久久黄色大片| 亚洲中文字幕无码久久综合网| 欧美精品乱码99久久蜜桃| 亚洲欧美日韩久久精品第一区| 蜜臀久久99精品久久久久久小说| 久久精品国产清高在天天线| 国产欧美久久久精品|