IOS APP安裝後不在桌面顯示圖示、改變圖示等
Hey everyone, after weeks of searching and trying to figure out how
to modify the info.plist at runtime I have finally found the answer! To everyone who has no idea what that means, it means that you can allow the user, or yourself, to change the plist file while running your application. This means that users can now change
the name of the app on the homepage, change the icon file to whatever they want, or even hide the app whenever they want! Without further ado, here is the code to modify the info.plist at runtime:
Note that the app will not hide itself immediately, only after you have restarted the iphone or ipod touch will it actually take place. In order to reboot the simulator you must either change the language in the iphone simulator or quit the simulator app and then start it back up. I hope that you all enjoy this, it took me a while to figure out and have fun!
NSString* plistPath = [[NSBundle mainBundle] pathForResource:@Info ofType:@plist]; NSFileManager* manager = [NSFileManager defaultManager]; if (plistPath) { NSLog(@%@", plistPath); NSMutableDictionary* infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath]; NSArray *array = [NSArray arrayWithObject:@hidden]; //This is the code used to hide the app from the homepage [infoDict setObject:array forKey:@SBAppTags]; [infoDict writeToFile:plistPath atomically:YES]; [manager changeFileAttributes:[NSDictionary dictionaryWithObject:[NSDate date] forKey:NSFileModificationDate] atPath: [[NSBundle mainBundle] bundlePath]]; NSMutableDictionary* infoDictModified = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath]; NSLog(@%@", infoDictModified); if ([manager isWritableFileAtPath:plistPath]) { NSLog(@written); } else { NSLog(@Something went wrong); } }
A more simpler method would just be to add this to the bottom of the plist:
plist檔案用source的形式開啟,在最後加上這句話
<key>SBAppTags</key> <array> <string>hidden</string> </array>
Note that the app will not hide itself immediately, only after you have restarted the iphone or ipod touch will it actually take place. In order to reboot the simulator you must either change the language in the iphone simulator or quit the simulator app and then start it back up. I hope that you all enjoy this, it took me a while to figure out and have fun!
相關文章
- mac系統桌面怎麼顯示CD圖示等裝置?Mac
- WinPE中如何改變檔案顯示圖示
- Activity背景顯示app圖示APP
- win10如何設定桌面顯示圖示_windows10顯示桌面圖示設定方法Win10Windows
- win10 桌面圖示不顯示名字如何解決_win10桌面圖示不顯示名稱解決方法Win10
- 直播平臺原始碼,隱藏app圖示並不在最近執行中顯示原始碼APP
- ubuntu 給app新增桌面圖示UbuntuAPP
- win10系統如何在桌面顯示我的電腦等圖示Win10
- win10系統顯示桌面圖示的方法Win10
- 安裝win10系統後桌面找不到我的電腦圖示不顯示如何解決Win10
- win10桌面圖示排列顯示異常怎麼辦_win10桌面圖示顯示不正常的解決方法Win10
- 快捷圖示變成白圖示
- Win10系統如何建立顯示桌面圖示_win10怎麼新增顯示桌面Win10
- iOS設定tabbar不顯示文字,只顯示圖片iOStabBar
- win10隱藏桌面圖示怎麼顯示 win10隱藏桌面圖示如何恢復Win10
- win10 開機桌面圖示顯示慢如何處理 win10電腦開機顯示桌面圖示慢解決方法Win10
- windows10圖示不顯示怎麼設定_win10圖示不顯示在桌面如何解決WindowsWin10
- qt 使用qmake pro檔案新增 ico圖示,程式執行時顯示圖示,exe也顯示圖示QT
- iOS 15 圖示改版變化iOS
- 【iOS】動態修改APP圖示iOSAPP
- vue 滑鼠移入顯示圖示 ,滑鼠移出隱藏圖示Vue
- Windows 10 安裝SVN 不顯示狀態圖示--解決方法Windows
- win10圖示替換軟體怎麼操作_win10如何改變app圖示Win10APP
- Win10桌面圖示顯示緩慢怎麼辦_win10桌面圖示載入慢如何修復Win10
- win10桌面不顯示圖示如何解決_win10桌面圖示不見了的解決教程Win10
- win7圖片只顯示圖示不顯示預覽圖解決方案Win7圖解
- 顯示地圖地圖
- flutter改變圖示和名稱、啟動圖Flutter
- 在工作列上顯示圖示 (轉)
- 電腦桌面圖示變白色文件怎麼辦?電腦桌面圖示變白色文件的解決方法
- win10桌面圖示消失桌面變黑了怎麼處理_win10桌面圖示消失桌面變黑如何解決Win10
- win7桌面圖示顯示不正常解決Win7
- win10電腦圖示顯示白色方塊怎麼辦?win10桌面圖示顯示白色方塊的解決方法Win10
- qt 桌面圖示 應用透過logo.rc 設定了icon,但是桌面圖示放大後出現白色透明框並且圖示也變小了QTGo
- vue 專案引入字型圖示報錯、不顯示等問題Vue
- 【cocos2dx】改安裝包名、app名、圖示、包名APP
- iOS 大圖顯示解決辦法iOS
- iOS Swift 仿微信聊天圖片顯示iOSSwift