UITableView

时间:2017-11-11 22:23:36

标签: ios swift uitableview user-interface storyboard

我有一个带有tablewView的viewController和3个按钮。 看起来像这样

Looks like this

但是当我按下单元格以查看详细信息并返回导航栏时,它看起来像这样

it looks like this(没有按钮)。

TableView.frame.x.y.width.height和所有3个icons.frame.x.y.width.height保持不变。请分享关于它可能是什么的想法。

我已将AutoLayout设置为:

object.frame = CGrect()

编辑: 我的班级有按钮:homeButton, favouritButton, userProfileButton

    let screenHeight = UIScreen.main.bounds.size.height
    let screenWidth = UIScreen.main.bounds.size.width
    @IBOutlet var favouritButton: UIButton!
    @IBOutlet var userProfileButton: UIButton!
    @IBOutlet var homeButton: UIButton!
        override func viewDidLayoutSubviews() {

            tableView.frame = CGRect(x: 0,y: 0, width: screenWidth, height: screenHeight - 49)
            let tabBarSegmention = screenWidth / 3
            homeButton.frame = CGRect(x: (tabBarSegmention / 2) - (homeButton.frame.width/2), y:  screenHeight - 6 - homeButton.frame.height, width: homeButton.frame.width, height: homeButton.frame.height)
            favouritButton.frame = CGRect(x: homeButton.frame.origin.x + tabBarSegmention, y:  screenHeight - 6 - homeButton.frame.height, width: homeButton.frame.width, height: homeButton.frame.height)
            userProfileButton.frame = CGRect(x: favouritButton.frame.origin.x + tabBarSegmention, y:  screenHeight - 6 - homeButton.frame.height, width: homeButton.frame.width, height: homeButton.frame.height)
        }

0 个答案:

没有答案