简体   繁体   中英

Can't see the ion-nav-button

In my ionic app,I have a feature where the user should see in app's nav bar horizontal dot lines,click on them and then a pop up menu should appear with two menu items(add to favorites and add a comment). The below picture illustrates my point.

应用程式的图片

The problem though is that those 3 horizontal dots don't appear in the nav bar of the app.

Here is the code for the ion-nav-button.

                <ion-view view-title="News Details">
              <ion-content>
                  <ion-nav-buttons side="secondary">
                        <div class="buttons">
                          <button class="button button-icon icon ion-more"
                                  ng-click="openPopover($event)"></button>
                        </div>
                  </ion-nav-buttons>
                  <div class="card">
                      <div class="item item-body item-text-wrap">
                           <img class="full-image" ng-src="{{detailedNews.image}}" alt="Uthappizza">
                            <h3>{{detailedNews.title}}</h3>
                            <p>{{detailedNews.description}}</p>
                      </div>
                  </div>
                  <div class="row">
                        <div class="col col-offset-10">
                               <h4>Customer Comments &nbsp;&nbsp;&nbsp;
                                   <small>Sort by: &nbsp;
                                         <input type="text" ng-model="orderText">
                                      </small></h4>
                                <ul class="list">
                                    <li ng-repeat="comment in dish.comments | orderBy:orderText">
                                      <blockquote>
                                         <p>{{comment.rating}} Stars</p>
                                         <p>{{comment.comment}}</p>
                                         <footer>{{comment.author}}, {{comment.date | date:'MMM. dd, yyyy'}}</footer>
                                      </blockquote>
                                    </li>
                                </ul>
                        </div>
            </div>
            </ion-content>
            </ion-view>

Maybe there is something wrong in this line.

<button class="button button-icon icon ion-more"ng-
 click="openPopover($event)"></button>

Can you help me?

Thanks,

Theo.

Try wrapping the <ion-nav-buttons></ion-nav-buttons> directive inside an <ion-nav-bar></ion-nav-bar> directive and taking it out of ion-content .

 <ion-view view-title="News Details"> <ion-nav-bar> <ion-nav-buttons side="secondary"> <div class="buttons"> <button class="button button-icon icon ion-more" ng-click="openPopover($event)"></button> </div> </ion-nav-buttons> </ion-nav-bar> <ion-content> ... 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM