fix img
This commit is contained in:
parent
7ba146abf9
commit
a497280270
21
dimensionhub/Assets.xcassets/ph_img_big.imageset/Contents.json
vendored
Normal file
21
dimensionhub/Assets.xcassets/ph_img_big.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "ph_img_big.jpg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
dimensionhub/Assets.xcassets/ph_img_big.imageset/ph_img_big.jpg
vendored
Normal file
BIN
dimensionhub/Assets.xcassets/ph_img_big.imageset/ph_img_big.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 178 KiB |
21
dimensionhub/Assets.xcassets/ph_img_medium.imageset/Contents.json
vendored
Normal file
21
dimensionhub/Assets.xcassets/ph_img_medium.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "ph_img_medium.jpg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
dimensionhub/Assets.xcassets/ph_img_medium.imageset/ph_img_medium.jpg
vendored
Normal file
BIN
dimensionhub/Assets.xcassets/ph_img_medium.imageset/ph_img_medium.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
21
dimensionhub/Assets.xcassets/ph_img_small.imageset/Contents.json
vendored
Normal file
21
dimensionhub/Assets.xcassets/ph_img_small.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "ph_img_small.jpg",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
dimensionhub/Assets.xcassets/ph_img_small.imageset/ph_img_small.jpg
vendored
Normal file
BIN
dimensionhub/Assets.xcassets/ph_img_small.imageset/ph_img_small.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
@ -291,14 +291,24 @@ extension DetailView {
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .center) {
|
||||
AsyncImage(url: URL(string: episode.thumb)) { image in
|
||||
|
||||
AsyncImage(url: URL(string: episode.thumb)) { phase in
|
||||
switch phase {
|
||||
case .empty:
|
||||
ProgressView()
|
||||
case .success(let image):
|
||||
image
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.frame(width: 90, height: 70)
|
||||
.clipped()
|
||||
} placeholder: {
|
||||
ProgressView()
|
||||
default:
|
||||
Image("ph_img_small")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.clipped()
|
||||
}
|
||||
|
||||
}
|
||||
.frame(width: 90, height: 70)
|
||||
.overlay(alignment: .topLeading) {
|
||||
|
||||
@ -397,13 +397,22 @@ extension IndexView {
|
||||
ForEach(dramaItem.episodes) { item in
|
||||
VStack(alignment: .center) {
|
||||
GeometryReader { geometry in
|
||||
AsyncImage(url: URL(string: item.thumb)) { image in
|
||||
|
||||
AsyncImage(url: URL(string: item.thumb)) { phase in
|
||||
switch phase {
|
||||
case .empty:
|
||||
ProgressView()
|
||||
case .success(let image):
|
||||
image
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.clipped()
|
||||
} placeholder: {
|
||||
ProgressView()
|
||||
default:
|
||||
Image("ph_img_medium")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.clipped()
|
||||
}
|
||||
}
|
||||
.frame(width: geometry.frame(in: .local).width, height: 80)
|
||||
.overlay(alignment: .topLeading) {
|
||||
@ -463,14 +472,23 @@ extension IndexView {
|
||||
|
||||
ForEach(group.items, id: \.id) { item in
|
||||
NavigationLink(destination: DetailView(id: item.id)) {
|
||||
AsyncImage(url: URL(string: item.thumb)) { image in
|
||||
AsyncImage(url: URL(string: item.thumb)) { phase in
|
||||
switch phase {
|
||||
case .empty:
|
||||
ProgressView()
|
||||
case .success(let image):
|
||||
image
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.frame(width: 370, height: 180)
|
||||
.clipped()
|
||||
} placeholder: {
|
||||
ProgressView()
|
||||
default:
|
||||
Image("ph_img_big")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.clipped()
|
||||
}
|
||||
|
||||
}
|
||||
.frame(width: 370, height: 180)
|
||||
.overlay(alignment: .topLeading) {
|
||||
|
||||
@ -148,14 +148,24 @@ extension ListView {
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .center) {
|
||||
AsyncImage(url: URL(string: episode.thumb)) { image in
|
||||
|
||||
AsyncImage(url: URL(string: episode.thumb)) { phase in
|
||||
switch phase {
|
||||
case .empty:
|
||||
ProgressView()
|
||||
case .success(let image):
|
||||
image
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.frame(width: 90, height: 60)
|
||||
.clipped()
|
||||
} placeholder: {
|
||||
ProgressView()
|
||||
default:
|
||||
Image("ph_img_medium")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.clipped()
|
||||
}
|
||||
|
||||
}
|
||||
.frame(width: 90, height: 60)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user