diff --git a/CloudEmoticon2iOS.xcodeproj/project.xcworkspace/xcuserdata/yashi.xcuserdatad/UserInterfaceState.xcuserstate b/CloudEmoticon2iOS.xcodeproj/project.xcworkspace/xcuserdata/yashi.xcuserdatad/UserInterfaceState.xcuserstate index 8393a35..5011c3c 100644 Binary files a/CloudEmoticon2iOS.xcodeproj/project.xcworkspace/xcuserdata/yashi.xcuserdatad/UserInterfaceState.xcuserstate and b/CloudEmoticon2iOS.xcodeproj/project.xcworkspace/xcuserdata/yashi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CloudEmoticon2iOS/AddonTableViewController.swift b/CloudEmoticon2iOS/AddonTableViewController.swift index 299cd49..c8667a3 100644 --- a/CloudEmoticon2iOS/AddonTableViewController.swift +++ b/CloudEmoticon2iOS/AddonTableViewController.swift @@ -57,7 +57,7 @@ class AddonTableViewController: UITableViewController { // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem() NSNotificationCenter.defaultCenter().addObserver(self, selector: "切换主题", name: "切换主题通知", object: nil) - NSNotificationCenter.defaultCenter().addObserver(self, selector: "屏幕旋转", name: "屏幕旋转通知", object: nil) + NSNotificationCenter.defaultCenter().addObserver(self, selector: "屏幕旋转:", name: "屏幕旋转通知", object: nil) 切换主题() } @@ -65,7 +65,12 @@ class AddonTableViewController: UITableViewController { self.tableView.reloadData() } - func 屏幕旋转() { + func 屏幕旋转(通知:NSNotification) { + let 新坐标:NSArray = 通知.object as! NSArray + let 宽:CGFloat = 新坐标.objectAtIndex(0) as! CGFloat + let 高:CGFloat = 新坐标.objectAtIndex(1) as! CGFloat + let backgroundView2:UIView = self.tableView.backgroundView?.subviews[0] as! UIView + backgroundView2.frame = CGRectMake(self.tableView.frame.origin.x, self.tableView.frame.origin.y, 宽, 高) 刷新背景图() } diff --git a/CloudEmoticon2iOS/SetTableViewController.swift b/CloudEmoticon2iOS/SetTableViewController.swift index 523a82a..b8660f8 100644 --- a/CloudEmoticon2iOS/SetTableViewController.swift +++ b/CloudEmoticon2iOS/SetTableViewController.swift @@ -46,7 +46,7 @@ class SetTableViewController: UITableViewController { // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem() NSNotificationCenter.defaultCenter().addObserver(self, selector: "切换主题", name: "切换主题通知", object: nil) - NSNotificationCenter.defaultCenter().addObserver(self, selector: "屏幕旋转", name: "屏幕旋转通知", object: nil) + NSNotificationCenter.defaultCenter().addObserver(self, selector: "屏幕旋转:", name: "屏幕旋转通知", object: nil) 切换主题() } @@ -54,7 +54,12 @@ class SetTableViewController: UITableViewController { self.tableView.reloadData() } - func 屏幕旋转() { + func 屏幕旋转(通知:NSNotification) { + let 新坐标:NSArray = 通知.object as! NSArray + let 宽:CGFloat = 新坐标.objectAtIndex(0) as! CGFloat + let 高:CGFloat = 新坐标.objectAtIndex(1) as! CGFloat + let backgroundView2:UIView = self.tableView.backgroundView?.subviews[0] as! UIView + backgroundView2.frame = CGRectMake(self.tableView.frame.origin.x, self.tableView.frame.origin.y, 宽, 高) 刷新背景图() }