I'm using Iconic 1 and I want to center the "MyAccount" in the header. I've had a look at the docs and tried the code but it places the content in the content pane.
This is the code I've got at the moment that displays the "MyAccount" at top:
<ion-view view-title="MyAccount">
<ion-content>
<h1>My Account</h1>
</ion-content>
</ion-view>
I'm thinking I'll need to add the <ion-header-bar></ion-header-bar> directive somewhere. I tried adding it but it didn't have the desired effect.
Can anyone suggest how to do this?
To use the dynamic header bar behavior in Ionic-Angular, use the <ion-header-bar> directive:
<ion-header-bar
title="MyAccount"
left-buttons="leftButtons"
right-buttons="rightButtons"
type="bar-positive"
align-title="center">
</ion-header-bar>
Source: Headers
Example:
<ion-header-bar align-title="center" class="bar-positive">
<div class="buttons">
<button class="button" ng-click="doSomething()">Left Button</button>
</div>
<h1 class="title">MyAccount</h1>
<div class="buttons">
<button class="button">Right Button</button>
</div>
</ion-header-bar>
<ion-content class="has-header">
Some content!
</ion-content>
Related
I have modal for displaying Attachments.
When I display one image in modal and pinch zoom , close the modal and click on second image, 2nd image is already zoomed.
How to stop this from happening?
<script id="modal.html" type="text/ng-template">
<ion-modal-view>
<div class="bar bar-header" class="ng-cloak">
<button class="button button-clear ion-ios-arrow-left fontSize25" ng-click="closeModal()"></button>
<h1 class="title customeHeared white-color">Attachment</h1>
</div>
<ion-content>
<ion-scroll zooming="true" direction="xy" delegate-handle="zoom-pane" class="zoom-pane" min-zoom="1">
<img ng-src="{{imagePath}}" style="width: 100%;padding: 20%;"/>
</video>
</ion-scroll>
</ion-content>
</ion-modal-view>
</script>
I have not found any solution for this, Closing this now.
If anyone comes here and finds it with an answer please let me know with a comment.
I have a simple application consists of a textbox and a footer, the problem i faced that when i write in the textbox , the footer moves up like this
What i want is to make the footer fixed at the bottom , and the keyboard appears above the footer .
Here's the code
<body ng-app="starter">
<ion-pane>
<ion-content>
<input type="text" />
</ion-content>
<div class="bar bar-footer bar-balanced">
<div class="title">Footer</div>
</div>
</ion-pane>
</body>
After 3 days i found the solution ,
YourProject\platforms\android\AndroidManifest
Set the android:windowSoftInputMode to adjustPan
you're not implementing it right
use ion-footer-bar directive
<ion-content class="has-footer">
Some content!
</ion-content>
<ion-footer-bar align-title="left" class="bar-assertive">
<div class="buttons">
<button class="button">Left Button</button>
</div>
<h1 class="title">Title!</h1>
<div class="buttons" ng-click="doSomething()">
<button class="button">Right Button</button>
</div>
</ion-footer-bar>
http://ionicframework.com/docs/api/directive/ionFooterBar/
I'm creating an app using Ionic 1.3.2, and I have one step when user choose your login type, from facebook or from app, after the user make your login it will redirect to other step when has a <ion-side-menus> and the user can use the app. The problem is I created the first step (choose login) with <ion-nav-bar> and in second step (side-menus) also has <ion-nav-bar> on content of <ion-side-menus> and the header of first step seems override the header of second step bugging the layout, I want to use the same header on both steps.
My question is, how could I use only one header, in that case header created on first step, and the second step use this header too ?
My scene is like below.
index.html (first step)
<body ng-app="starter" ng-controller="MainCtrl" animation="slide-left-right-ios7">
<!-- The nav bar that will be updated as we navigate-->
<ion-nav-bar class="bar bar-header bar-assertive" align-title="center">
</ion-nav-bar>
<!-- where the initial view template will be rendered -->
<ion-nav-view></ion-nav-view>
</body>
main.html (first step, where user choose your login type)
<ion-view view-title="MeuPedido" align-title="center">
<ion-content>
<div class="principal">
<a class="button button-block button-positive" ng-click="fbLogin();">Login com Facebook</a>
<button class="button button-block button-energized" ng-click="goTo('login');">
Entrar
</button>
<button class="button button-block button-energized" ng-click="goTo('addUsuario');">
Cadastrar
</button>
</div>
</ion-content>
</ion-view>
sidemenu.html (second step, after user make his login)
<ion-side-menus ng-controller='CtrlSideMenu' data-ng-init="loadImage();">
<!-- Center content -->
<ion-side-menu-content>
<!--app has header on index.html -->
<ion-nav-bar class="bar-assertive">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-buttons side="left" class="has-header">
<button class="button button-icon button-clear ion-navicon" menu-toggle="left">
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="tabsContent"></ion-nav-view>
</ion-side-menu-content>
<!-- Left menu -->
<ion-side-menu side="left">
<ion-header-bar>
<div>
<div class="row">
<div class="col col-90 text-center">
<img ng-src="{{imageURL}}" class="round_image">
</div>
</div>
<div class="row">
<div class="col col-90 text-center customTitle">{{nome}}</div>
</div>
</div>
</ion-header-bar>
<ion-content style="margin-top:200px;">
<ion-list>
<ion-item menu-close href="#/app/search">
Search
</ion-item>
<ion-item menu-close href="#/app/browse">
Browse
</ion-item>
<ion-item menu-close href="#/app/playlists">
Playlists
</ion-item>
</ion-list>
</ion-content>
<ion-footer-bar class="bar bar-footer">
<h6>Desenvolvido por Iguana Sistemas</h6>
</ion-footer-bar>
</ion-side-menu>
</ion-side-menus>
here image of first step, look at in this point has header
here image of second step, note that header of first step is overriding header inside ion-side-menus and bugging the layout.
I don't really get what you want to achieve, but side menu is one thing (it controls the view that appears when you open the side menu)and the the main view is another - is the view that user will see and from here you can open side-menu. you can have different nav bars for this 2 views. but from your code it looks like you have 1 main view that logs in the user and then changes itself to display the feed and a side-menu.
you multiple options: 1. make the title and color of the nav bar variable and change them with angular. 2. create another view for second step and override the nav bar.
You should have a structure something like this: -> main view(login) ->second view(feed) that also has a side menu
Below is the template code to a page in my app. You can see that I am using the ion-nav-bar. I would like to disable the ion-nav-bar on the login screen and to not have a back button to go back to the login screen.
The best solution I can come up with is to remove <ion-nav-bar> from the login page and add an ng-show directive to <ion-nav-back-button> that tests if the previous page is login and hides the tag in that case.
Is there any better design pattern for this?
<ion-view view-title="Sales">
<ion-pane>
<ion-nav-bar class="bar-stable">
<ion-nav-back-button></ion-nav-back-button>
<ion-content class="padding">
<ionic-datepicker input-obj="datepickerObject">
<button class="button button-block button-positive"> {{datepickerObject.inputDate | date:'dd - MMMM - yyyy'}}</button>
</ionic-datepicker>
<div class="list list-inset">
<label class="item item-input">
<input type="text" placeholder="Amount" ng-model="data.amount">
</label>
</div>
<button class="button button-block button-stable" ng-click="enter()">Save</button>
</ion-content>
</ion-nav-bar>
</ion-pane>
</ion-view>
To your ion-view, you need to add the hide-nav-bar directive and set it to true to hide it on this page.
Like so
<ion-view hide-nav-bar="true">
This will hide the whole nav-bar when you enter the view
For hiding back button just add this tag to your view just like this
<ion-view title="Login" hide-back-button="true">
Not sure if it's ionic thats buggy or something else ..
I am creating a simple header (and nothing else)
<ion-header-bar class="bar-positive">
<h1 class="title">Title!</h1>
<div class="buttons">
<button class="button">Right Button</button>
</div>
</ion-header-bar>
I expect to see a "Title" and a button on the header bar. But that doesn't happen.
http://plnkr.co/edit/vPkirnzlFX1I9B7W9H8N?p=preview
problem was with the ionic bundle:
using the below solved the issue:
<script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>