Skip to content

Commit

Permalink
修复图片获取不到bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JmoVxia committed Jan 22, 2018
1 parent bc8e714 commit dc35952
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CLPlayer.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'CLPlayer'
s.version = '1.1.8'
s.version = '1.1.9'
s.summary = 'AVPlayer定制的视频播放器'
s.homepage = 'https://github.com/JmoVxia/CLPlayer'
s.license = 'MIT'
Expand Down
4 changes: 2 additions & 2 deletions CLPlayer/CLPlayerMaskView.m
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ -(void)layoutSubviews{
}
#pragma mark - 获取资源图片
- (UIImage *)getPictureWithName:(NSString *)name{
NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"CLPlayer" ofType:@"bundle"]];
NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[self class]] pathForResource:@"CLPlayer" ofType:@"bundle"]];
NSString *path = [bundle pathForResource:name ofType:@"png"];
return [UIImage imageWithContentsOfFile:path];
return [[UIImage imageWithContentsOfFile:path] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}


Expand Down
4 changes: 2 additions & 2 deletions CLPlayer/CLSlider.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
}
#pragma mark - 获取资源图片
- (UIImage *)getPictureWithName:(NSString *)name{
NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"CLPlayer" ofType:@"bundle"]];
NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[self class]] pathForResource:@"CLPlayer" ofType:@"bundle"]];
NSString *path = [bundle pathForResource:name ofType:@"png"];
return [UIImage imageWithContentsOfFile:path];
return [[UIImage imageWithContentsOfFile:path] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}


Expand Down
1 change: 0 additions & 1 deletion CLPlayerDemo/CLViewController3.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ @implementation CLViewController3

- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor redColor];
self.navigationItem.title = @"pushViewController";

CLPlayerView *playerView = [[CLPlayerView alloc] initWithFrame:CGRectMake(0, 90, self.view.CLwidth, 300)];
Expand Down

0 comments on commit dc35952

Please sign in to comment.