视图控制模块:
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)
img2.image = UIImage.init(named: "2.jpg")
self.view.addSubview(img2)
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
编写tab栏:
<scene sceneID="K8v-p0-0Hy">
<objects>
<tabBarController id="SmL-Fv-o8e" sceneMemberID="viewController">
<tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="CRM-WH-Q02">
<rect key="frame" x="0.0" y="0.0" width="375" height="49"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tabBar>
<connections>
<segue destination="S3a-c9-zvn" kind="relationship" relationship="viewControllers" id="tHM-bk-Axk"/>
<segue destination="kdA-xd-JX6" kind="relationship" relationship="viewControllers" id="aeh-IN-PUc"/>
<segue destination="Cqw-QF-NTY" kind="relationship" relationship="viewControllers" id="CuR-Dt-GUL"/>
<segue destination="2Bw-gb-WZ1" kind="relationship" relationship="viewControllers" id="ufN-mL-VXI"/>
<segue destination="gaP-AP-D1C" kind="relationship" relationship="viewControllers" id="rxx-uC-KWG"/>
</connections>
</tabBarController>
<placeholder placeholderIdentifier="IBFirstResponder" id="a6B-8c-a38" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-2313" y="-202"/>
</scene>