99偷拍视频精品区一区二,口述久久久久久久久久久久,国产精品夫妇激情啪发布,成人永久免费网站在线观看,国产精品高清免费在线,青青草在线观看视频观看,久久久久久国产一区,天天婷婷久久18禁,日韩动漫av在线播放直播

iOSUIImage/UIImageView處理-創新互聯

今天處理了把iOS6版本改為iOS7的過程了,遇到了一些問題,查了一些資料,紀錄一下:

成都創新互聯公司堅持“要么做到,要么別承諾”的工作理念,服務領域包括:網站建設、成都網站設計、企業官網、英文網站、手機端網站、網站推廣等服務,滿足客戶于互聯網時代的長子網站設計、移動媒體設計的需求,幫助企業找到有效的互聯網解決方案。努力成為您成熟可靠的網絡建設合作伙伴!

   1,iPad1上,更新圖標以后最后先把原有程序卸載了,要不然圖片殘留很嚴重,還遇到一個問題說是調試過程中有其他進程在調試,重啟iPad1就好了。就因為圖片殘留的問題,至少耽擱我1-2小時。

   2,UINavigationBar自定義:看看支持到4.3的解法:

#pragma mark -
#pragma mark 自定義導航欄背景
@implementation UINavigationBar (CustomImage)
- (UIImage *)barBackground
{
    UIImage *bg = [UIImage p_w_picpathNamed:@"bg_navbar_ios7.png"];
    if ([FMUSystem getOSVersion] < 7.0) {
        bg = [FMUImage p_w_picpathByScalingAndCroppingForSize:CGSizeMake(320, 44) SourceImage:bg CropType:FMUIMAGE_SCALE_TYPE_FITMIN];
//        UIGraphicsBeginImageContext(CGSizeMake(320,44));
//        CGContextRef context = UIGraphicsGetCurrentContext();
//        [bg drawInRect: CGRectMake(0, 0, 320,44)];
//        bg = UIGraphicsGetImageFromCurrentImageContext();
//        UIGraphicsEndImageContext();
    }
                                                                                                                                                                                                         
    return bg;
}
- (void)didMoveToSuperview
{
    //iOS5 only
    if ([self respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)])
    {
        [self setBackgroundImage:[self barBackground] forBarMetrics:UIBarMetricsDefault];
    }
}
//this doesn't work on iOS5 but is needed for iOS4 and earlier
- (void)drawRect:(CGRect)rect
{
    //draw p_w_picpath
    [[self barBackground] drawInRect:rect];
}
@end

    為了支持iOS7,使用320*64的圖片,還得我自己來裁一下。我個人比較喜歡注釋掉的方法。上面的函數是其他同事實現的公有方法。

    3,生成圓形圖

    3.1 layer層畫圓角

UIImageView * p_w_picpathView = [[UIImageView alloc] initWithImage:[UIImage p_w_picpathNamed:@"oiuyfdsa.png"]];
p_w_picpathView.frame = CGRectMake(20.f, 20.f, 100.f, 100.f);
p_w_picpathView.layer.masksToBounds = YES;
p_w_picpathView.layer.cornerRadius = 50;

    3.2 畫布畫

-(UIImage*) circleImage:(UIImage*) p_w_picpath withParam:(CGFloat) inset {
    UIGraphicsBeginImageContext(p_w_picpath.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetLineWidth(context, 2);
    CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
    CGRect rect = CGRectMake(inset, inset, p_w_picpath.size.width - inset * 2.0f, p_w_picpath.size.height - inset * 2.0f);
    CGContextAddEllipseInRect(context, rect);
    CGContextClip(context);
                                                                                                                                                    
    [p_w_picpath drawInRect:rect];
    CGContextAddEllipseInRect(context, rect);
    CGContextStrokePath(context);
    UIImage *newimg = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return newimg;
}

    4,圖片平鋪的方式

    4.1 圖片轉換為uicolor,設為背景,有點像OpenGL中紋理設置。

UIColor *circleColorPattern = [UIColor colorWithPatternImage:
[UIImage p_w_picpathNamed:@"circle_pattern.png"]];

    4.2 圖片轉換為類似android中9.png的方式

    iOS5之后:

UIImage *buttonBackgroundImage = [[UIImage p_w_picpathNamed:@"button_bkg.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0,13,0,13)];
[button setBackgroundImage:buttonBackgroundImage forState:UIControlStateNormal];

    這是取27個像素,中間那個像素拉伸活者壓縮。

    iOS5之前的方法:

- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth
topCapHeight:(NSInteger)topCapHeight;

  這個方法有局限性,它只能指定leftCapWidth和topCapHeight,然后只有一個像素能夠重復,也就是rightCapWidth為 p_w_picpathWidth-leftCapWidth-1,而bottomCapHeight為 p_w_picpathHeight - topCapHeight -1,所以重復的始終是中間的那一個像素.

  最后摘錄一份iOS6,7的適配文章,這文章已經看過2遍以上,可是需要的時候還要查,所以放在這里。

Like many of you, I have been very busy upgrading my apps to make them fit for iOS 7. The latest version of iOS introduces lots of visual changes. From a developer’s perspective, the navigation bar and status bar are two noticeable changes that need to cater. The status bar is now transparent, that means the navigation bar behind it shows through. In some cases, the background p_w_picpath for a navigation bar can extend up behind the status bar.

Some time ago, I’ve written a tutorial about how to customize a navigation bar. I think it’s time to revisit the customization and see how it is done in iOS 7. Here are some of the tips and tricks that you’ll find in this article:

  • Setting the background color of navigation bar

  • Using background p_w_picpath in navigation bar

  • Customizing the color of back button

  • Changing the font of navigation bar title

  • Adding multiple bar button items

  • Changing the style of status bar

  • Hiding the status bar

iOS UIImage/UIImageView處理

You’ll need Xcode 5 to properly execute the code as presented in this tutorial. So if you’re still using older versions of Xcode, make sure you upgrade to Xcode 5 before running the sample Xcode project.

Default Navigation Bar in iOS 7

Before we go in to the customization, let’s first take a look at the default navigation bar generated by Xcode 5 and iOS 7. Simply create a Xcode project using Single View Controller template. Embed the view controller in a navigation controller. If you don’t want to start from scratch, you can justdownload this sample Xcode project.

Xcode 5 bundles both iOS 6 and iOS 7 Simulators. Try to run the sample project using both versions of Simulators.

iOS UIImage/UIImageView處理

As you can see, the navigation bar in iOS 7 is by default intertwined with the status bar. The default color is also changed to light gray, as well.

Changing the Background Color of Navigation Bar

In iOS 7, the tintColor property is no longer used for setting the color of the bar. Instead, use the barTintColor property to change the background color. You can insert the below code in the didFinishLaunchingWithOptions: of AppDelegate.m.

<tbody id="kmom8"><nav id="kmom8"></nav></tbody>
1

另外有需要云服務器可以了解下創新互聯scvps.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業上云的綜合解決方案,具有“安全穩定、簡單易用、服務可用性高、性價比高”等特點與優勢,專為企業上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。

名稱欄目:iOSUIImage/UIImageView處理-創新互聯
文章源于:http://www.yijiale78.com/article22/cshdjc.html

成都網站建設公司_創新互聯,為您提供微信公眾號面包屑導航外貿建站全網營銷推廣網站設計公司企業建站

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

<delect id="kmom8"><xmp id="kmom8"></xmp></delect>
  • <acronym id="kmom8"></acronym>
      <acronym id="kmom8"></acronym>
        <dd id="kmom8"><wbr id="kmom8"></wbr></dd>
      • <dd id="kmom8"></dd>