视图控制模块:
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.}
}
主图插入与位置实现:
import UIKit
let appw = UIScreen.main.bounds.size.width
let apph = UIScreen.main.bounds.size.height
class jibenxinxiViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.title=“基本信息”
// Do any additional setup after loading the view.
let img = UIImageView()
img.frame = CGRect.init(x: 50, y: 64, width: appw-100, height: appw-100)
img.image = UIImage.init(named: “1.jpg”)
self.view.addSubview(img)
let img2 = UIImageView()
img2.frame = CGRect.init(x: 50, y: 79+(appw-100)+15, width: appw-100, height: appw-100)