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 {
|
var body: some View {
|
||||||
VStack(alignment: .center) {
|
VStack(alignment: .center) {
|
||||||
AsyncImage(url: URL(string: episode.thumb)) { image in
|
|
||||||
image
|
AsyncImage(url: URL(string: episode.thumb)) { phase in
|
||||||
.resizable()
|
switch phase {
|
||||||
.aspectRatio(contentMode: .fill)
|
case .empty:
|
||||||
.frame(width: 90, height: 70)
|
ProgressView()
|
||||||
.clipped()
|
case .success(let image):
|
||||||
} placeholder: {
|
image
|
||||||
ProgressView()
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fill)
|
||||||
|
.frame(width: 90, height: 70)
|
||||||
|
.clipped()
|
||||||
|
default:
|
||||||
|
Image("ph_img_small")
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fill)
|
||||||
|
.clipped()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.frame(width: 90, height: 70)
|
.frame(width: 90, height: 70)
|
||||||
.overlay(alignment: .topLeading) {
|
.overlay(alignment: .topLeading) {
|
||||||
|
|||||||
@ -397,13 +397,22 @@ extension IndexView {
|
|||||||
ForEach(dramaItem.episodes) { item in
|
ForEach(dramaItem.episodes) { item in
|
||||||
VStack(alignment: .center) {
|
VStack(alignment: .center) {
|
||||||
GeometryReader { geometry in
|
GeometryReader { geometry in
|
||||||
AsyncImage(url: URL(string: item.thumb)) { image in
|
|
||||||
image
|
AsyncImage(url: URL(string: item.thumb)) { phase in
|
||||||
.resizable()
|
switch phase {
|
||||||
.aspectRatio(contentMode: .fill)
|
case .empty:
|
||||||
.clipped()
|
ProgressView()
|
||||||
} placeholder: {
|
case .success(let image):
|
||||||
ProgressView()
|
image
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fill)
|
||||||
|
.clipped()
|
||||||
|
default:
|
||||||
|
Image("ph_img_medium")
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fill)
|
||||||
|
.clipped()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.frame(width: geometry.frame(in: .local).width, height: 80)
|
.frame(width: geometry.frame(in: .local).width, height: 80)
|
||||||
.overlay(alignment: .topLeading) {
|
.overlay(alignment: .topLeading) {
|
||||||
@ -463,14 +472,23 @@ extension IndexView {
|
|||||||
|
|
||||||
ForEach(group.items, id: \.id) { item in
|
ForEach(group.items, id: \.id) { item in
|
||||||
NavigationLink(destination: DetailView(id: item.id)) {
|
NavigationLink(destination: DetailView(id: item.id)) {
|
||||||
AsyncImage(url: URL(string: item.thumb)) { image in
|
AsyncImage(url: URL(string: item.thumb)) { phase in
|
||||||
image
|
switch phase {
|
||||||
.resizable()
|
case .empty:
|
||||||
.aspectRatio(contentMode: .fill)
|
ProgressView()
|
||||||
.frame(width: 370, height: 180)
|
case .success(let image):
|
||||||
.clipped()
|
image
|
||||||
} placeholder: {
|
.resizable()
|
||||||
ProgressView()
|
.aspectRatio(contentMode: .fill)
|
||||||
|
.frame(width: 370, height: 180)
|
||||||
|
.clipped()
|
||||||
|
default:
|
||||||
|
Image("ph_img_big")
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fill)
|
||||||
|
.clipped()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.frame(width: 370, height: 180)
|
.frame(width: 370, height: 180)
|
||||||
.overlay(alignment: .topLeading) {
|
.overlay(alignment: .topLeading) {
|
||||||
|
|||||||
@ -148,14 +148,24 @@ extension ListView {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack(alignment: .center) {
|
HStack(alignment: .center) {
|
||||||
AsyncImage(url: URL(string: episode.thumb)) { image in
|
|
||||||
image
|
AsyncImage(url: URL(string: episode.thumb)) { phase in
|
||||||
.resizable()
|
switch phase {
|
||||||
.aspectRatio(contentMode: .fill)
|
case .empty:
|
||||||
.frame(width: 90, height: 60)
|
ProgressView()
|
||||||
.clipped()
|
case .success(let image):
|
||||||
} placeholder: {
|
image
|
||||||
ProgressView()
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fill)
|
||||||
|
.frame(width: 90, height: 60)
|
||||||
|
.clipped()
|
||||||
|
default:
|
||||||
|
Image("ph_img_medium")
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fill)
|
||||||
|
.clipped()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.frame(width: 90, height: 60)
|
.frame(width: 90, height: 60)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user