I am working on ionic1 and angularjs I have already worked with tabs but now I am facing an issues where my tabs should be appear only in a particular div so on the particular area of my html page only my ion-tabs should work but it is not displaying well as we i am expected.
here is my .html page
<ion-modal-view>
<div class="bar bar-header bar-calm">
<button class="button icon ion-navicon"></button>
<h1 class="title">Happy Home</h1>
<button class="button" ng-click="closeLogout()">LogOut</button>
</div>
<ion-content>
<div class = "row responsive-sm" style = "padding-top:50px">
<div class = "col">
<label class="item item-input item-select">
<br>
<select>
<option>B09-301</option>
<option selected>G45-94</option>
<option>R8910</option>
</select>
</label>
</div>
</div>
<div style="background-color: #DEE0E0">
<div class = "row">
<div class = "col-33">
<div class="card">
<div class="item item-text-avatar" style="background-color: #11C1F3">
<i class="icon ion-ios-home item-floating-label" ></i>
MEMBERS
</div>
</div>
</div>
<div class = "col-33">
<div class="card">
<div class="item item-text-avatar" style="background-color: #11C1F3">
<i class="icon ion-model-s item-floating-label"></i>
Vechical
</div>
</div>
</div>
<div class = "col-33">
<div class="card">
<div class="item item-text-avatar" style="background-color: #11C1F3">
<i class="icon ion-ios-bookmarks item-floating-label"></i>
Booking
</div>
</div>
</div>
</div>
<div class ="row">
<div class = "col col-top">
<div class="card">
<div class="item item-text-avatar" style="background-color: #11C1F3">
<i class="icon ion-person-stalker item-floating-label"></i>
Staff
</div>
</div>
</div>
<div class = "col col-top">
<div class="card">
<div class="item item-text-avatar" style="background-color: #11C1F3">
<i class="icon ion-ios-home-outline item-floating-label"></i>
Visitor
</div>
</div>
</div>
</div>
</div>
<div class = "row">
<ion-tabs class="tabs-striped tabs-top tabs-background-positive tabs-color-light">
<ion-tab title="MyDues">
<ion-content>
<h1>happy home Dues</h1>
</ion-content>
</ion-tab>
<ion-tab title="Deposite">
<ion-content>
<h1>happy home Deposite</h1>
</ion-content>
</ion-tab>
<ion-tab title="Advance">
<ion-content>
<h1>happy home Advance</h1>
</ion-content>
</ion-tab>
<ion-tab title="History">
<ion-content>
<h1>happy home History</h1>
</ion-content>
</ion-tab>
</ion-tabs>
</div>
</ion-content>
Here you can see the ion-tabs where i have implemented the tabs div
and here is the sample image where i should use ion-tabs help me if some one know how to use the ion-tabs for my MY DUES,ADVANCE,DEPOSIT,HISTORY.
THANK YOU,
Put inside of <div> and add this css to this div
width: 100%;
position: fixed;
Working for me
I am working on ionic 3, I got this way, I put the tab inside ion-content and works for me.
<ion-content>
<ion-card>
<ion-row fixed padding>
<ion-col>
<h2 class="card-titulo"> Localidade</h2>
<h2 class="card-titulo"> Data Início</h2>
</ion-col>
<ion-col>
<h2 class="card-descricao">
<ion-icon name="pin"></ion-icon>
Fortaleza-CE
</h2>
<h2 class="card-descricao">
<ion-icon name="calendar"></ion-icon>
24/01/18 10:47
</h2>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<ion-item>
<ion-label>Clima</ion-label>
<ion-select [(ngModel)]="clima">
<ion-option>Frio</ion-option>
<ion-option>quente</ion-option>
</ion-select>
</ion-item>
</ion-col>
<ion-col>
<ion-item>
<ion-label>Equipamento</ion-label>
<ion-select [(ngModel)]="equipamento">
<ion-option>Medidor</ion-option>
<ion-option>Equipament teste</ion-option>
</ion-select>
</ion-item>
</ion-col>
</ion-row>
</ion-card>
<ion-content>
<tabs-obra></tabs-obra>
</ion-content>
<ion-fab bottom right>
<button ion-fab mini (click)="abrirListaAtividade()">
<ion-icon name="checkmark"></ion-icon>
</button>
</ion-fab>
Related
I'm trying to increase the size of the ion-slide and the img to match each other.
I'm trying to do this using CSS, but I'm not managing to increase the size of the two together.
HTML:
<ion-view view-title="Prefeitura Municipal">
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" menu-toggle="left">
</button>
</ion-nav-buttons>
<ion-content>
<ion-slide-box>
<ion-slide>
<div class = "box boxImagem">
<img ng-src="img/Boletos.jpg" class="minha-imagem">
</div>
</ion-slide>
<ion-slide>
<div class = "box boxImagem2">
<img ng-src="img/Arraiá.jpg" class="minha-imagem">
</div>
</ion-slide>
<ion-slide>
<div class = "box boxImagem3">
<img ng-src="img/Alimentação.jpg" class="minha-imagem">
</div>
</ion-slide>
</ion-slide-box>
<div>
<div class="row icon-row">
<ion-item class="col text-center">
<img class="full-image" src="img/capitol-building.png"></img>
<br>Prefeitura
</ion-item>
<ion-item class="col text-center">
<img class="full-image" src="img/leader-with-loudspeaker.png" ui-sref="app.principal"></img>
<br>Ouvidoria<br>
</ion-item>
<ion-item class="col text-center">
<img class="full-image" src="img/earth-pictures.png"></img>
<br>Turismo<br>
</ion-item>
</div>
<div class="row icon-row">
<ion-item class="col text-center">
<img class="full-image" src="img/college-graduation.png"></img>
<br>Educação <br>
</ion-item>
<ion-item class="col text-center">
<img class="full-image" src="img/doctor-stethoscope.png"></img>
<br>Saúde
</ion-item>
<ion-item class="col text-center">
<img class="full-image" src="img/bus-service.png"></img>
<br>Serviços<br>Públicos
</ion-item>
<!-- <ion-item class="col text-center">
<a class="botao button button-positive" href="#/app/site">Icon</a>
<br>Site
</ion-item> -->
</div>
</div>
</ion-content>
<div class="bar bar-footer bar-balanced">
<button class="button icon ion-android-home">Inicio</button>
<h1 class="title">Prefeitura</h1>
<button class="button icon ion-earth pull-right">Site</button>
</div>
</ion-view>
CSS
boxImgem, .boxImagem2, .boxImagem3{
width: 100%;
height: 100%;
}
.minha-imagem{
float: left;
width: 100%;
text-align: center;
margin: 0px 0px 0;
}
As far as I know the width is set via JavaScript and thus will overwrite the css rules.
Also it's easier to help if you use a service such as codepen to create a working demo of your code
ion-view header bar is not displaying in my ionic app. can anyone tell me about the issue? i;ve tried aloot of things to fix it but nothing happens.
Offer.html
<ion-view style="font-family: 'Lobster', cursive; " view-title="Ad's Cafe">
<ion-nav-bar class="bar-assertive">
<ion-nav-back-button></ion-nav-back-button>
<ion-content class="has-header">
<ion-list>
<button style="font-family: 'Cherry Cream Soda', cursive; "class="button button-full button-stable">
<i class="ion-speakerphone"></i>
Offer Details
</button>
<ion-item ng-repeat="offer in offers ">
<div class="list card">
<div class="item item-text-wrap item-divider">
<u> <h1><i class="ion-android-restaurante"></i>{{offer.Title}} </h1> </u>
</div>
<div class="item item-text-wrap">
<u><img style=" border: 1px solid black;
width: 100%;
height: auto" class="img-responsive " ng-src="{{offer.link}} "
> </u>
</div>
<div class="item item-text-wrap">
<h3> {{offer.Desc}} </h3>
</div>
</div>
</ion-item>
</ion-list>
</ion-content>
</ion-view>
I think you forgot to close </ion-nav-bar>
<ion-view style="font-family: 'Lobster', cursive; " view-title="Ad's Cafe">
<ion-nav-bar class="bar-assertive">
<ion-nav-back-button></ion-nav-back-button>
</ion-nav-bar>
<ion-content class="has-header">
<ion-list>
<button style="font-family: 'Cherry Cream Soda', cursive; "class="button button-full button-stable">
<i class="ion-speakerphone"></i>
Offer Details
</button>
<ion-item ng-repeat="offer in offers ">
<div class="list card">
<div class="item item-text-wrap item-divider">
<u> <h1><i class="ion-android-restaurante"></i>{{offer.Title}} </h1> </u>
</div>
<div class="item item-text-wrap">
<u><img style=" border: 1px solid black;
width: 100%;
height: auto" class="img-responsive " ng-src="{{offer.link}} "
> </u>
</div>
<div class="item item-text-wrap">
<h3> {{offer.Desc}} </h3>
</div>
</div>
</ion-item>
</ion-list>
</ion-content>
</ion-view>
I'm using ionic in my project. How can I set the back button on the left in the header? Here is my code:
<ion-header-bar class="bar-positive" align-title="left" >
<h1 class="title" style="text-align: center">More Info</h1>
<button ng-click="myGoBack()" class="button button-clear"> <i class="ion- chevron-left " ></i> Back </button>
</ion-header-bar>
<ion-view>
<ion-content >
<ion-list class="list-inset" style="margin-right: 1%;margin-right: 1%">
<ion-item style="margin-right: 1%;margin-right: 1%" class="item-text-wrap" ng-init="missionDetail.getAllFicheMissionDetails(missionId,desId);">
vehicule :{{payloadMissionDetail.vehicule}}
Mission :{{payloadMissionDetail.mission}}
Chau1 :{{payloadMissionDetail.ch}}
Chau2 :{{payloadMissionDetail.ch2}}
Départ :{{payloadMissionDetail.depart}}
</ion-item>
</ion-list>
You can use below code.
<ion-header-bar align-title="left" class="bar-positive">
<div class="buttons">
<button class="button" ng-click="doSomething()">Left Button</button>
</div>
<h1 class="title">Title!</h1>
<div class="buttons">
<button class="button">Right Button</button>
</div>
</ion-header-bar>
#Documentation : http://ionicframework.com/docs/api/directive/ionHeaderBar/
I just want to remove the tittle bar (header) (blue side part in image)inside this page.
my ionic code in about.html page
<nav-page hide-nav-bar="true">
<ion-view>
<ion-content class="app-view">
<div class="list-inset-feed">
<div class="item item-text-wrap">
<div class="row responsive-sm text-center">
<div class="col">
<h1 class="text-white">{{"about_page_title" | translate}}</h1>
<h3 class ="text-white">version 1.0.0</h1>
<div class="image_container">
<img alt="logo" height="100" src="img/logo.png">
</div>
<a class="text-white" href="#" onclick="window.open('http://abcd.html', '_system', 'location=yes'); return false;">
privacy policy
</a>
</div>
</div>
</div>
</div>
</ion-content>
Add hide-nav-bar="true" inside your <ion-view> tag.
HTML
<ion-view hide-nav-bar="true">
<ion-content >
</ion-content>
</ion-view>
I'm trying to put header and top navbar inside of the ion-view directive.
If I put header nav navbar outside of the ion-view tag page is blinking black if page is initialized.
But if I try to insert header and top navbar inside of the ion-view title and heading in the header is not displayed.
Could somebody tell me what I'm doing wrong?
Maybe some tag inside is missing?
Thanks for any help.
Here is the code of the template:
<div class="bar bar-header bar-positive has-tabs-top">
<button class="button button-icon icon ion-chevron-left" ui-sref="home">
</button>
<h1 class="title">{{ 'RESULTS_BY_DAY' | translate }}</h1>
<button class="button button-icon icon ion-stats-bars" ui-sref="daily-chart">
</button>
</div>
<!--TOP TAB BAR -->
<div class="tabs-striped tabs-top tabs-background-light tabs-light tabs-color-dark">
<div class="tabs">
<a class="tab-item orange">
Home
</a>
<a class="tab-item">
Favorites
</a>
<a class="tab-item">
Settings
</a>
</div>
</div>
<ion-view>
<div class="bar bar-header bar-positive has-tabs-top">
<button class="button button-icon icon ion-chevron-left" ui-sref="home">
</button>
<h1 class="title">{{ 'RESULTS_BY_DAY' | translate }}</h1>
<button class="button button-icon icon ion-stats-bars" ui-sref="daily-chart">
</button>
</div>
<!--TOP TAB BAR -->
<div class="tabs-striped tabs-top tabs-background-light tabs-light tabs-color-dark">
<div class="tabs">
<a class="tab-item orange">
Home
</a>
<a class="tab-item">
Favorites
</a>
<a class="tab-item">
Settings
</a>
</div>
</div>
<ion-content ng-controller="DailyListCtrl">
<!--WRITEOUT OVERAL STATS FOR DAYS -->
<ion-list class="list" >
<ion-item class="item itemListCustom" ng-repeat="listDataItem in listData">
<div class="listDateTimeBlock">
<div class="day"><h3>{{listDataItem.DATE_FROM_DD}}</h3></div>
<div class="month"><h3>{{listDataItem.DATE_FROM_MM}}</h3></div>
</div>
<!--ROW ONE -->
<div id="left">
<div class="left-inner">
{{ 'APPOINTMENT_SUCCESS_RATE' | translate }}:
</div>
<div class="right-inner">
{{listDataItem.SUCCESS_RATE}} %
</div>
</div>
<div id="right">
<div class="left-inner floatRight">
{{ 'DIALS' | translate }}:
</div>
<div class="right-inner">
{{listDataItem.DIALS_CNT}}
</div>
</div>
<!--ROW TWO-->
<div id="left">
<div class="left-inner ">
{{ 'SUCCESS_RATE_SINCE_START' | translate }}:
</div>
<div class="right-inner">
{{listDataItem.SUCCESS_RATE_SINCE}} %
</div>
</div>
<div id="right">
<div class="left-inner floatRight">
{{ 'CONVERSATIONS' | translate }} :
</div>
<div class="right-inner">
{{listDataItem.CONVERS_CNT}}
</div>
</div>
<!--ROW THREE-->
<div id="left">
<div class="left-inner">
{{ 'MY_DEFICIT' | translate }}:
</div>
<div class="right-inner">
{{listDataItem.DEFICIT}} %
</div>
</div>
<div id="right">
<div class="left-inner floatRight">
{{ 'APPOINTMENTS' | translate }} :
</div>
<div class="right-inner">
{{listDataItem.APPT_CNT}}
</div>
</div>
</ion-item>
</ion-list>
<ion-infinite-scroll
icon="ion-loading-c"
distance="30%"
on-infinite="setDateRange();">
</ion-infinite-scroll>
</ion-content>
<!-- BOTTOM TABS -->
<div class="tabs-striped tabs-background-positive tabs-light">
<div class="tabs">
<a class="tab-item active" ui-sref="daily-list" href="/#/daily-list">
<i class="icon ion-ios7-paper-outline"></i>
</a>
<a class="tab-item" ui-sref="weekly-list" href="/#/weekly-list">
<i class="icon ion-star"></i>
</a>
<a class="tab-item" ui-sref="daily-list" href="/#/daily-list">
<i class="icon ion-gear-a"></i>
</a>
<a class="tab-item" ui-sref="daily-list" href="/#/daily-list">
<i class="icon ion-gear-a"></i>
</a>
</div>
</div>
</ion-view>
Here are some examples of navbar usage:
Simple page with buttons left and right:
http://codepen.io/beaver71/pen/YwLELa
<ion-view title="onepage">
<ion-nav-buttons side="left">
<button class="button">
LeftButton
</button>
</ion-nav-buttons>
<ion-nav-buttons side="right">
<button class="button button-assertive">
RightButton
</button>
</ion-nav-buttons>
<ion-content class="padding">
<!-- The content of the page -->
</ion-content>
</ion-view>
Navigation via side menu:
http://codepen.io/beaver71/pen/XXBvYp
Navigation via side menu and tab bar:
http://codepen.io/beaver71/pen/xZWXBO
Try to use the JavaScript versions of tabs and navigation bars.
They are easier to be manipulated in JS code, because they come with the services $ionicTabsDelegate and $ionicNavBarDelegate.