change positions of switch and detailed buttion

This commit is contained in:
Bob Sun 2017-02-14 19:19:47 +08:00
parent ad64944648
commit 5399f2be48
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -32,8 +32,8 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController {
hideUnknownSwitch.onTintColor = UIColor(displayP3Red: 0, green: 122.0/255, blue: 1, alpha: 1)
hideUnknownSwitch.sizeToFit()
let detailButton = UIButton(type: .detailDisclosure)
hideUnknownSwitch.frame = CGRect(x: 0, y: 0, width: hideUnknownSwitch.bounds.width, height: hideUnknownSwitch.bounds.height)
detailButton.frame = CGRect(x: hideUnknownSwitch.bounds.width+10, y: 5, width: detailButton.bounds.width, height: detailButton.bounds.height)
hideUnknownSwitch.frame = CGRect(x: detailButton.bounds.width+10, y: 0, width: hideUnknownSwitch.bounds.width, height: hideUnknownSwitch.bounds.height)
detailButton.frame = CGRect(x: 0, y: 5, width: detailButton.bounds.width, height: detailButton.bounds.height)
detailButton.addTarget(self, action: #selector(GeneralSettingsTableViewController.tapHideUnknownSwitchDetailButton(_:)), for: UIControlEvents.touchDown)
let accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: detailButton.bounds.width + hideUnknownSwitch.bounds.width+10, height: hideUnknownSwitch.bounds.height))
accessoryView.addSubview(detailButton)