当前位置:网站首页>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 :
边栏推荐
- 油猴插件
- China HDI market production and marketing demand and investment forecast analysis report Ⓢ 2022 ~ 2028
- WiFi 2.4g/5g/6g channel distribution
- C程序设计的初步认识
- Remember the experience of automatically jumping to spinach station when the home page was tampered with
- Functions and differences between static and Const
- Global and Chinese market of telematics boxes 2022-2028: Research Report on technology, participants, trends, market size and share
- Imitation Netease cloud music applet
- 使用dnSpy對無源碼EXE或DLL進行反編譯並且修改
- 内存分析器 (MAT)
猜你喜欢

Is it OK for fresh students to change careers to do software testing? The senior answered with his own experience

Kali2021.4a build PWN environment

2022 G3 boiler water treatment registration examination and G3 boiler water treatment examination papers

How PHP drives mongodb

Functions and differences between static and Const
![[vulnhub shooting range] impulse: lupinone](/img/27/b92eeceefd1c71f19d926bdd1eee8b.jpg)
[vulnhub shooting range] impulse: lupinone

MySQL——JDBC

MySQL - index

Imitation Netease cloud music applet

Bluebridge cup Guoxin Changtian single chip microcomputer -- detailed explanation of schematic diagram (IV)
随机推荐
No matter how hot the metauniverse is, it cannot be separated from data
Report on the development status and investment planning trends of China's data center industry Ⓡ 2022 ~ 2028
Idea shortcut word operation
Luogu deep foundation part 1 Introduction to language Chapter 7 functions and structures
China's Call Center Industry 14th five year plan direction and operation analysis report Ⓔ 2022 ~ 2028
Collections SQL communes
Introduction to kubernetes
A little understanding of GSLB (global server load balance) technology
Redis concludes that the second pipeline publishes / subscribes to bloom filter redis as a database and caches RDB AOF redis configuration files
DOM light switch case
Bluebridge cup Guoxin Changtian single chip microcomputer -- detailed explanation of schematic diagram (IV)
Go language slice interview real question 7 consecutive questions
MySQL - idea connects to MySQL
Oil monkey plug-in
Cognitive fallacy: Wittgenstein's ruler
Global and Chinese market of wireless hard disk 2022-2028: Research Report on technology, participants, trends, market size and share
Advanced technology management - how to examine candidates in the interview and increase the entry probability
Report on the current situation and development trend of ethoxylated sodium alkyl sulfate industry in the world and China Ⓞ 2022 ~ 2027
MySQL -- standardize database design
Development mode and Prospect of China's IT training industry strategic planning trend report Ⓣ 2022 ~ 2028