右侧带有引导导航栏的白色栏

时间:2017-02-08 09:55:18

标签: css twitter-bootstrap twitter-bootstrap-3

我正在尝试使用一系列链接(LI元素)和一个右手搜索框来渲染导航栏,该搜索框没有折叠,而是显示在小屏幕下方。

几乎下面的代码的工作原理是它根据需要单独显示搜索栏并在折叠导航下方。我正在努力确定确切的原因或解决方案。似乎如果一个容器直接放在nav元素下面,我只会在导航栏折叠时获得该栏。

Navbar代码:

<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>                        
      </button>
      <a class="navbar-brand" href="/">Food</a>
    </div>
    <div class="nav navbar-nav navbar-right">
        <form class="navbar-form" action="/results/" role="search">
            <div class="input-group">
                <input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term">
                <div class="input-group-btn">
                    <button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
                </div>
            </div>
        </form>
    </div>
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav">
        <li class="active"><a href="/">Home</a></li>
        <li><a href="/item/food/">foods</a></li>
        <li><a href="/item/wine/">wines</a></li>
        <li><a href="/admin/">admin</a></li>
      </ul>
      </div>
  </div>
</nav>

回顾了以下内容,但没有一个解决方案似乎解决了我的问题 Twitter bootstrap white gap on right side of page

1 个答案:

答案 0 :(得分:1)

我认为您的问题可能来自导航栏。尝试用col-xs-12类将它包装在div中:

 var skipFetchedNoRow = 0
 let fetchRequest = NSFetchRequest(entityName: "EntityName")
 fetchRequest.fetchLimit = 10 //set limit 
 fetchRequest.fetchOffset = skipFetchedNoRow //need to update every time because can not predicate how many rows before fetched

do{
        if let fetchResult = try managedObjectContext.executeFetchRequest(fetchRequest) as? [EntityName]{

            yourGlobalArr = fetchResult
            skipFetchedNoRow =+ 10
           //Reload table if your data display in tableview

        }else{
            print("Not Found More Data")
        }
    }catch{
        print("Error")
 }

这应解决问题。