如何使用bootstrap使一个div可滚动和其他不可滚动

时间:2015-10-29 17:49:12

标签: html css twitter-bootstrap

我正在创建一个引导程序模板,它将包含两个div,其中一个div应该是左一个固定而另一个应该是可滚动的,类似于http://www.trulia.com。我尝试了以下代码:

<div class="row">
    <div class="col-md-6">
        <img src="">
    </div><!--Fixed one-->
    <div class="col-md-6">
    </div><!--Scrollable-->
</div>

1 个答案:

答案 0 :(得分:3)

它将解决您的问题

func tabPressed(desiredIndex: Int){
    let tabBarController: UITabBarController? = self.parentViewController?.childViewControllers[1] as? UITabBarController
    let selectedIndex = tabBarController?.selectedIndex
    if desiredIndex != selectedIndex{
        tabBarController?.selectedIndex = desiredIndex
        unsetBackgroundColors()
    }
    else{
        let nav = tabBarController?.childViewControllers[desiredIndex] as! UINavigationController
        nav.popToRootViewControllerAnimated(true)
    }
}

@IBAction func homePressed(sender: AnyObject) {
    tabPressed(0)
    homeButtonView.backgroundColor = buttonColor
}
@IBAction func searchPressed(sender: AnyObject) {
    tabPressed(1)
    searchButtonView.backgroundColor = buttonColor
}

@IBAction func savedPressed(sender: AnyObject) {
    tabPressed(2)
    savedButtonView.backgroundColor = buttonColor
    AppDelegate().softResetBadgeCount()
}

@IBAction func categoriesPressed(sender: AnyObject) {
    tabPressed(3)
    categoriesButtonView.backgroundColor = buttonColor
}