CodeSolution

Please wait...

Create CollapsingToolbar in ionic version 1 like native android

@CollapsingToolbar  @ ionic  @ version  @ animation  @ header  @ profile  @ swip animation   @ native   @ android  

Create CollapsingToolbar in ionic version 1. they look like native CollapsingToolbar with animation

Create a project run this command:

ionic start <project name> --type ionic1


then move into the newly created directory:

cd <project name>


Link js and css file in index.html

<script src="lib/cool_profile.js"></script><br>
<link href="css/ion-cool-profile.css" rel="stylesheet">


Open app.js in www ->js-> app.js and add the module of js file

angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'ion-cool-profile'])


Open home.html in www ->Templates-> home.html and add code

<ion-view>
    <div user-profile-header class="text-center">
        <div class="text-center">
            <img class="user-profile-image" ng-src="img/adam.jpg">
        </div>
        <div class="user-profile-name ellipsis">Code Solution</div>
        <div class="row">
            <div class="col">
                <h4>Friends</h4>
                <div>550</div>
            </div>
            <div class="col">
                <h4>Messages</h4>
                <div>24</div>
            </div>
            <div class="col">
                <h4>Photos</h4>
                <div>172</div>
            </div>
        </div>
    </div>
    <div user-profile-sub-header>
        <div class="row">
            <i class="ion-android-arrow-back col col-10"></i>
            <div class="col col-90">Code Solution</div>
        </div>
    </div>
    <ion-content ion-parallax-profile delegate-handle="profileScroll" bounce="false">
        <p ng-repeat="val in [0,1,2,3,4,5,6,7,8,9]" class="card padding">
            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
        </p>
    </ion-content>
</ion-view>

CollapsingToolbar like android application code is done you add platform in your application code platform add command: 

ionic cordova platform add android/ios/windows


Build and Run command

ionic cordova build android/ios/windows
ionic cordova run android/ios/windows


Github link: https://github.com/Sudarshan101/CollapsingToolbarIonic


See demo : https://www.youtube.com/watch?v=kjvBBJarneo


thank you

Comments 0

Reply