当前位置:网站首页>IPhone development swift foundation 09 assets
IPhone development swift foundation 09 assets
2022-07-03 21:58:00 【Happy party】
Assets Set color set on
Using color sets can make the style of applications consistent .
Choose a color 
Then use in the code :
Because the color set is iOS11 New features that have just emerged , Therefore, you need to judge the system version when using .
if #available(iOS 11.0, *){
self.view.backgroundColor = UIColor(named: "ForegroundColor")
}
Running results :
Assets Set vector picture on
Development in the past , Because you need to adapt to different sizes of screens , Therefore, image resources often need to prepare three sizes @1x、@2x、@3x. But after introducing vector pictures , There is no need to prepare drawings of three sizes .
stay Assets Click “+” Button , Select import “Import…” Options , Then select the vector image to be imported . Here is a red envelope vector graph , The file format is as follows svg At the end of the .

Remember to check the picture attribute “Preserve Vector Data” Options .
Verification code :
if #available(iOS 11.0, *){
self.view.backgroundColor = UIColor(named: "ForegroundColor")
let imageView = UIImageView(image: UIImage(named: "hongbao"))
imageView.frame = CGRect(x: 0, y: 0, width: 480, height: 560)
view.addSubview(imageView)
}
Running results :
边栏推荐
- On my first day at work, this API timeout optimization put me down!
- MySQL——索引
- 十大券商开户注册安全靠谱吗?有没有风险的?
- 技术管理进阶——如何在面试中考察候选人并增大入职概率
- Day 9 HomeWrok-ClassHierarchyAnalysis
- Miscellaneous things that don't miss the right business
- Investment planning analysis and prospect prediction report of China's satellite application industry during the 14th five year plan Ⓑ 2022 ~ 2028
- Decompile and modify the non source exe or DLL with dnspy
- DOM light switch case
- Selenium has three waiting methods (forced waiting, implicit waiting, and display waiting)
猜你喜欢

17 websites for practicing automated testing. I'm sure you'll like them

Blue Bridge Cup Guoxin Changtian MCU -- program download (III)

How PHP adds two numbers

Control loop of program (while loop)

Notes on MySQL related knowledge points (startup, index)

Functions and differences between static and Const

Common SQL sets

MySQL——JDBC

Getting started with postman -- built-in dynamic parameters, custom parameters and assertions

Kali2021.4a build PWN environment
随机推荐
Analysis report on the development trend and Prospect of global and Chinese supercontinuum laser source industry Ⓚ 2022 ~ 2027
[vulnhub shooting range] impulse: lupinone
Supply and demand situation and market scale calculation report of China's portable energy storage power PES industry Ⓛ 2022 ~ 2028
Report on the development status and investment planning trends of China's data center industry Ⓡ 2022 ~ 2028
treevalue——Master Nested Data Like Tensor
MySQL - index
国泰君安证券开户是安全可靠的么?怎么开国泰君安证券账户
Global and Chinese market of gallic acid 2022-2028: Research Report on technology, participants, trends, market size and share
Luogu deep foundation part 1 Introduction to language Chapter 7 functions and structures
Memory analyzer (MAT)
TiDB 之 TiCDC6.0 初体验
Is the account opening of Guotai Junan Securities safe and reliable? How to open Guotai Junan Securities Account
Netfilter ARP log
十大券商开户注册安全靠谱吗?有没有风险的?
Introduction to kubernetes
js demo 計算本年度還剩下多少天
MySQL——JDBC
Blue Bridge Cup Guoxin Changtian single chip microcomputer -- software environment (II)
Covariance
Redis concludes that the second pipeline publishes / subscribes to bloom filter redis as a database and caches RDB AOF redis configuration files