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
当我按下后退按钮.的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) 我试图在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) ios ×3
iphone ×3
animation ×1
icarousel ×1
ios7 ×1
objective-c ×1
uibezierpath ×1
uiimageview ×1