CNUpSlideView.swift
1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// CNUpSlideView.swift
// metaCode
//
// Created by daojian on 2023/5/31.
//
import Foundation
import YYCategories
import WebKit
///上滑显示的VIew
class CNUpSlideView:UIView{
override init(frame: CGRect) {
super.init(frame: frame)
self.initUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func initUI()
{
self.backgroundColor = UIColor.white;
self.clipsToBounds = true;
self.layer.cornerRadius = 20;
let webView:WKWebView = WKWebView.init(frame: CGRectMake(10, 20, self.width - 20, self.height - 20))
let url: URL! = URL.init(string: "https://www.baidu.com")
webView.load(URLRequest.init(url:url))
webView.scrollView.showsVerticalScrollIndicator = false
webView.scrollView.showsHorizontalScrollIndicator = false
self.addSubview(webView)
// let imageview : UIImageView = UIImageView.init(frame: CGRect(x: 20, y: 10, width: self.width - 40, height: self.height - 20))
// imageview.image = UIImage(named: "homePage_payMoneyImage")
//
// self.addSubview(imageview)
}
}