Skip to content

Commit

Permalink
fix: App icon not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
iHTCboy committed Apr 3, 2023
1 parent 79e2810 commit 511b08f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"images" : [
{
"filename" : "iAppStroe.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "iAppStroe.png",
"idiom" : "universal",
"scale" : "2x"
},
Expand Down
7 changes: 6 additions & 1 deletion iAppStore/components/setting/AboutAppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ struct AboutAppView: View {
var body: some View {
ScrollView {
Spacer().frame(height: 50)
Image("iAppStore_icon").cornerRadius(15).padding(.bottom, 10)
Image("iAppStore_icon")
.resizable()
.frame(maxWidth: 90)
.frame(maxHeight: 90)
.cornerRadius(15)
.padding(.bottom, 10)
Text("iAppStore").fontWeight(.bold).padding(.bottom, 5)
Text("v \(appVersion ?? "") (\(appSubVersion ?? ""))").font(.footnote).foregroundColor(.gray).padding(.bottom, 10)
Text("iAppStore 是一款使用 SwiftUI 打造的苹果商店工具类 App。").padding([.leading, .trailing], 20).padding(.bottom, 10)
Expand Down
10 changes: 4 additions & 6 deletions iAppStore/components/setting/SettingHome.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct SettingItemCell: View {
var title: String
var index: Int
@State private var iconViewIsExpanded: Bool = false
@State private var icons: [String] = ["", "37", "37iOS", "37AppStore", "Apple", "AppleRainbow"]
@State private var icons: [String] = ["iAppStore", "37", "37iOS", "37AppStore", "Apple", "AppleRainbow"]

var body: some View {

Expand All @@ -74,15 +74,13 @@ struct SettingItemCell: View {
let type = icons[index]
VStack{
HStack {
Image(type.count > 0 ? type + "_icon" : "iAppStroe_icon")
Image(type + "_icon")
.resizable()
.renderingMode(.original)
.frame(width: 65, height: 65)
.cornerRadius(15)
.padding(.bottom, 10)
.padding(.leading, 5)

Text((type.count > 0 ? type : "默认") + "图标").padding(.leading, 15)
Text((index == 0 ? "默认" : type) + "图标").padding(.leading, 15)

Spacer()

Expand All @@ -91,7 +89,7 @@ struct SettingItemCell: View {
}
.onTapGesture {

UIApplication.shared.setAlternateIconName(type.count > 0 ? type : nil)
UIApplication.shared.setAlternateIconName(index == 0 ? nil : type)

withAnimation{
iconViewIsExpanded = false
Expand Down

0 comments on commit 511b08f

Please sign in to comment.