我想UITableView在UIView内创建,但它不起作用.
这是我的代码 -
import UIKit
import SnapKit
class ReorderView: UIView, UITableViewDataSource, UITableViewDelegate {
var tableView = UITableView()
let screenHeight = UIScreen.mainScreen().bounds.height
let screenWidth = UIScreen.mainScreen().bounds.width
override init(frame: CGRect){
super.init(frame: frame)
tableView.delegate = self
tableView.dataSource = self
tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell")
setup()
}
func setup() {
self.backgroundColor = UIColor.blackColor()
tableView = UITableView(frame: CGRect(x: 0, y: 0, width: screenWidth*0.5, height: screenHeight))
tableView.layer.backgroundColor = UIColor.blackColor().CGColor
self.addSubview(tableView)
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 10
}
func tableView(tableView: UITableView, …Run Code Online (Sandbox Code Playgroud) 我希望用户能够使用魔法链接登录,如下所示:
myapp://app.com/login-with-token?email=someEmail&token=sometoken
Run Code Online (Sandbox Code Playgroud)
由于某种原因,应用程序仅接收字符之前的部分,&如下所示:
myapp://app.com/login-with-token?email=someEmail
Run Code Online (Sandbox Code Playgroud)
有人知道如何解决这个问题吗?
编辑:这是我添加的内容AndroidManifest.xml
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myapp"
android:host="app.com"
android:pathPrefix="/"/>
</intent-filter>
Run Code Online (Sandbox Code Playgroud)