- Fix width cover

This commit is contained in:
Giuseppe Nucifora 2017-09-11 15:32:44 +02:00
parent fe64d3ab3a
commit 58e4a907e3
3 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'PNTwitterCover' s.name = 'PNTwitterCover'
s.version = '1.0.0' s.version = '1.0.1'
s.summary = 'PNTwitterCover is a UUIscrollView Category to add blur and zoom during scroll bounce' s.summary = 'PNTwitterCover is a UUIscrollView Category to add blur and zoom during scroll bounce'
# This description is used to generate tags and improve search results. # This description is used to generate tags and improve search results.

View File

@ -16,7 +16,7 @@
- (void)addTwitterCoverWithImage:(UIImage*)image; - (void)addTwitterCoverWithImage:(UIImage*)image;
- (void)addTwitterCoverWithImage:(UIImage*)image withTopView:(UIView*)topView; - (void)addTwitterCoverWithImage:(UIImage*)image withTopView:(UIView*)topView;
- (void)addTwitterCoverWithImage:(UIImage*)image withTopView:(UIView*)topView andHeight:(CGFloat) height; - (void)addTwitterCoverWithImage:(UIImage*)image withTopView:(UIView*)topView width:(CGFloat) width andHeight:(CGFloat) height;
- (void)removeTwitterCoverView; - (void)removeTwitterCoverView;
@end @end

View File

@ -31,12 +31,12 @@ static char UIScrollViewTwitterCover;
[self addTwitterCoverWithImage:image withTopView:nil]; [self addTwitterCoverWithImage:image withTopView:nil];
} }
- (void)addTwitterCoverWithImage:(UIImage*)image withTopView:(UIView*)topView { - (void)addTwitterCoverWithImage:(UIImage*)image withTopView:(UIView*)topView {
[self addTwitterCoverWithImage:image withTopView:topView andHeight:DefaultTwitterCoverViewHeight]; [self addTwitterCoverWithImage:image withTopView:topView width:[UIScreen mainScreen].bounds.size.width andHeight:DefaultTwitterCoverViewHeight];
} }
- (void)addTwitterCoverWithImage:(UIImage*)image withTopView:(UIView*)topView andHeight:(CGFloat) height - (void)addTwitterCoverWithImage:(UIImage*)image withTopView:(UIView*)topView width:(CGFloat) width andHeight:(CGFloat) height
{ {
PNTwitterCoverView *view = [[PNTwitterCoverView alloc] initWithFrame:CGRectMake(0,0, 320, height) andContentTopView:topView]; PNTwitterCoverView *view = [[PNTwitterCoverView alloc] initWithFrame:CGRectMake(0,0, width, height) andContentTopView:topView];
view.backgroundColor = [UIColor clearColor]; view.backgroundColor = [UIColor clearColor];
view.image = image; view.image = image;