I want the ion-header with fixed position. When keyboard appears it also scroll up with the rest of the screen in iOS. How to make ion-header remain stick to the top while other part of a screen scroll up?
<ion-header no-border>
<button class="left-button" (click)="delete()" >
Delete
</button>
<button class="right-button" (click)="save()" >
Save
</button>
</ion-header>
<ion-content id="home" class="background-Image" no-bounce>
<form [formGroup]="signup" novalidate>
<!-- User email -->
<div class="label">Wnat is your email?</div>
<div class="row">
<input class="input" autocorrect="off" type="email" placeholder="" formControlName="email" (input)="onEmailChange()" (blur)="onEmailSubmitted()" (keyup.enter)="hideKeyboard()">
<div class="validation-image">
<img [src]=validationImageEmail [hidden]=!validationImageEmail />
</div>
</div>
<hr class="underline">
</form>
</ion-content>
I think that the case is that your header lacks of a navbar or toolbar. By my experience both have the sabe result, but as the documentation says:
A Toolbar is a generic bar that is positioned above or below content. Unlike a Navbar, a toolbar can be used as a subheader. When toolbars are placed within an ion-header or ion-footer, the toolbars stay fixed in their respective location. When placed within ion-content, toolbars will scroll with the content.
So update your code like this:
<ion-header no-border>
<ion-toolbar>
<button class="left-button" (click)="delete()" >
Delete
</button>
<button class="right-button" (click)="save()" >
Save
</button>
</ion-toolbar>
</ion-header>
Hope this helps.
Related
I'm using Ionic FabButton for a floating button over the content in a fixed position. My code is:-
<ion-fab bottom right class="fab-image" (tap)="nextStep()">
<button ion-fab style="display: none;"></button>
<img src="assets/icon/custom/green_arrow.png" alt="">
</ion-fab>
My CSS fir this fab-image is as follows:-
.fab-image{
position: fixed !important;
width: 62px;
}
Now it's working on Android just fine:-
Click here to see how it's working on Android
And in iPhone it's working like this:
Click here to see how it working on iPhone
The problem is the glitch on iPhone. The fab button moves as the screen moves. Any ideas how to fix this issue?
I had the same problem on IOS, the fab wasn't fixed, here's my code.
<ion-content>
<!--other code-->
<ion-fab class="centered-fab" bottom>
<button ion-button block round color="primary" (click)="onClick()">
Click Me
</button>
</ion-fab>
</ion-content>
The issue is gone after I move outside of
<ion-content>
<!--other code-->
</ion-content>
<ion-fab class="centered-fab" bottom>
<button ion-button block round color="primary" (click)="onClick()">
Click Me
</button>
</ion-fab>
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
I have to create popover in an ion-view page. I try this HTML code :
<ion-view view-title="Search">
<div class="buttons">
<button class="button button-icon ion-more" ng-click="popover.show($event)">
</button>
</div>
<ion-content >
</ion-content >
</ion-view>
But i didn't get the button in the header page.
Any help is appreciated.
The button won't show up unless included in ion-header, ion-nav-buttons, ion-content. You can use the below to add the button to the header:
<ion-nav-buttons side="right">
<button class="button button-icon ion-more" ng-click="popover.show($event)">
</button>
</ion-nav-buttons>
Also make sure popover is present on your scope
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">