小编iOS*_*iOS的帖子

UIImageview在iOS7中不是动画,但在iOS6中运行良好

revealImgView.animationImages =[NSArray arrayWithObjects:[UIImage imageNamed:@"reveal1.png"],[UIImage imageNamed:@"reveal2.png"],[UIImage imageNamed:@"reveal3.png"],[UIImage imageNamed:@"reveal4.png"],[UIImage imageNamed:@"reveal5.png"],nil];
revealImgView.animationDuration=1.5;
revealImgView.animationRepeatCount=INFINITY;
[revealImgView startAnimating];
Run Code Online (Sandbox Code Playgroud)

这在iOS 6中运行良好,但在iOS 7中无效.我已经在笔尖中创建了UIImageView

iphone animation uiimageview ios ios7

3
推荐指数
1
解决办法
2057
查看次数

单击后退按钮时,iCarousel显示在上一页中

当我按下后退按钮.的iCarousel是仍显示为1个second.why是这种情况发生以及如何阻止this.I已经用故事创造一个iCarosel观点..

- (void)viewDidUnload
{
    [super viewDidUnload];
    self.carousel = nil;
}
- (void)dealloc
{
    carousel.delegate = nil;
    carousel.dataSource = nil;
}

- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel
{
  return [idOfAllWords count];
}

- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{
    UILabel *label = nil;

    //create new view if no view is available for recycling
    if (view == nil)
    {
        view = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 250.0f, 250.0f)];
        ((UIImageView *)view).image = [UIImage imageNamed:@"page.png"];
        view.contentMode = UIViewContentModeCenter;
        label = [[UILabel alloc] initWithFrame:view.bounds];
        label.backgroundColor = …
Run Code Online (Sandbox Code Playgroud)

iphone ios icarousel

3
推荐指数
1
解决办法
612
查看次数

在UIView类别中创建UIBezierPath.没有显示

我试图在UIView类别中使用UIBezierPath创建一个三角形.但没有显示三角形.还得到一个:CGContextSetFillColorWithColor.所以我的问题是如何使用UIView类别制作三角形或任何路径.演示项目

#import "UIView+Bubble.h"
#import <QuartzCore/QuartzCore.h>

@implementation UIView (Bubble)

+(UIView *)makeBubble{
    UIView *customView = [[UIView alloc] init];
    customView.frame=CGRectMake(0, 0, 320, 500);
    UIBezierPath *triangle = [UIBezierPath bezierPath];
    [triangle moveToPoint:CGPointMake(100, 0)];
    [triangle addLineToPoint:CGPointMake(0, 100)];
    [triangle addLineToPoint:CGPointMake(200, 100)];
    [triangle closePath];
    [[UIColor blackColor] setFill];
    [triangle fill];
    customView.layer.shadowPath = [triangle CGPath];
    return customView;
}
@end
Run Code Online (Sandbox Code Playgroud)

在ViewController.m中使用它像: -

- (void)viewDidLoad
{
    UIView *helpBubble=[UIView makeBubble];
    [self.view addSubview:helpBubble];
}
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ios objective-c-category uibezierpath

1
推荐指数
1
解决办法
1785
查看次数