Update demo to use modern way of image assets, and view layout for rotation

This commit is contained in:
DreamPiggy 2017-11-05 15:16:14 +08:00
parent 2dd61393ed
commit dfe68a5db6
7 changed files with 38 additions and 14 deletions

View File

@ -7,7 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
32892E311FAE898C00BE8320 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 32892E301FAE898C00BE8320 /* Images.xcassets */; };
32892E311FAE898C00BE8320 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 32892E301FAE898C00BE8320 /* Assets.xcassets */; };
32892E351FAE89FE00BE8320 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32892E341FAE89FD00BE8320 /* LaunchScreen.storyboard */; };
3E75A9861742DBE700DA412D /* CustomPathImages in Resources */ = {isa = PBXBuildFile; fileRef = 3E75A9851742DBE700DA412D /* CustomPathImages */; };
4314D1AA1D0E1181004B36C9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4314D1A91D0E1181004B36C9 /* main.m */; };
@ -42,8 +42,6 @@
537612B0155AB74D005750A4 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 537612AF155AB74D005750A4 /* DetailViewController.m */; };
537612B3155AB74D005750A4 /* MasterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 537612B1155AB74D005750A4 /* MasterViewController.xib */; };
537612B6155AB74D005750A4 /* DetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 537612B4155AB74D005750A4 /* DetailViewController.xib */; };
53A2B50D155B155A00B12423 /* placeholder.png in Resources */ = {isa = PBXBuildFile; fileRef = 53A2B50B155B155A00B12423 /* placeholder.png */; };
53A2B50E155B155A00B12423 /* placeholder@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 53A2B50C155B155A00B12423 /* placeholder@2x.png */; };
DA248D44195470FD00390AB0 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 537612E3155ABA3C005750A4 /* MapKit.framework */; };
/* End PBXBuildFile section */
@ -160,7 +158,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
32892E301FAE898C00BE8320 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
32892E301FAE898C00BE8320 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
32892E341FAE89FD00BE8320 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
3E75A9851742DBE700DA412D /* CustomPathImages */ = {isa = PBXFileReference; lastKnownFileType = folder; path = CustomPathImages; sourceTree = SOURCE_ROOT; };
4314D1A61D0E1181004B36C9 /* SDWebImage TV Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SDWebImage TV Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; };
@ -212,8 +210,6 @@
537612B5155AB74D005750A4 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DetailViewController.xib; sourceTree = "<group>"; };
537612E3155ABA3C005750A4 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; };
537612E6155ABA44005750A4 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; };
53A2B50B155B155A00B12423 /* placeholder.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = placeholder.png; sourceTree = "<group>"; };
53A2B50C155B155A00B12423 /* placeholder@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "placeholder@2x.png"; sourceTree = "<group>"; };
DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDWebImage.xcodeproj; path = ../SDWebImage.xcodeproj; sourceTree = "<group>"; };
/* End PBXFileReference section */
@ -389,7 +385,7 @@
537612B1155AB74D005750A4 /* MasterViewController.xib */,
537612B4155AB74D005750A4 /* DetailViewController.xib */,
32892E341FAE89FD00BE8320 /* LaunchScreen.storyboard */,
32892E301FAE898C00BE8320 /* Images.xcassets */,
32892E301FAE898C00BE8320 /* Assets.xcassets */,
537612A0155AB74D005750A4 /* Supporting Files */,
);
path = "SDWebImage Demo";
@ -401,8 +397,6 @@
537612A1155AB74D005750A4 /* SDWebImage Demo-Info.plist */,
537612A5155AB74D005750A4 /* main.m */,
537612A7155AB74D005750A4 /* SDWebImage Demo-Prefix.pch */,
53A2B50B155B155A00B12423 /* placeholder.png */,
53A2B50C155B155A00B12423 /* placeholder@2x.png */,
);
name = "Supporting Files";
sourceTree = "<group>";
@ -652,10 +646,8 @@
files = (
537612B3155AB74D005750A4 /* MasterViewController.xib in Resources */,
537612B6155AB74D005750A4 /* DetailViewController.xib in Resources */,
53A2B50D155B155A00B12423 /* placeholder.png in Resources */,
32892E311FAE898C00BE8320 /* Images.xcassets in Resources */,
32892E311FAE898C00BE8320 /* Assets.xcassets in Resources */,
32892E351FAE89FE00BE8320 /* LaunchScreen.storyboard in Resources */,
53A2B50E155B155A00B12423 /* placeholder@2x.png in Resources */,
3E75A9861742DBE700DA412D /* CustomPathImages in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "placeholder.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "placeholder@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -36,8 +36,6 @@
{
if (!_progressView) {
_progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];
_progressView.frame = CGRectMake(0, CGRectGetMaxY(self.navigationController.navigationBar.frame), CGRectGetWidth(self.view.frame), 2.0);
_progressView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
[self.view addSubview:_progressView];
}
return _progressView;
@ -75,6 +73,12 @@
[self configureView];
}
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
self.progressView.frame = CGRectMake(0, self.topLayoutGuide.length, CGRectGetWidth(self.view.bounds), 2.0);
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);