这里我将分享我学到的几种ionic登陆界面
2016-09-19 17:38
260 查看
在index.html文件里的内容是
[html] view plain copy <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <title></title> <link href="lib/ionic/css/ionic.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above <link href="css/ionic.app.css" rel="stylesheet"> --> <!-- ionic/angularjs js --> <script src="lib/ionic/js/ionic.bundle.js"></script> <!-- cordova script (this will be a 404 during development) --> <script src="cordova.js"></script> <!-- your app's js --> <script src="js/app.js"></script> <script src="js/controllers.js"></script> <script src="js/services.js"></script> </head> <body ng-app="starter"> <!-- The nav bar that will be updated as we navigate between views. --> <ion-nav-bar class="bar-stable"> <ion-nav-back-button> </ion-nav-back-button> </ion-nav-bar> <!-- The views will be rendered in the <ion-nav-view> directive below Templates are in the /templates folder (but you could also have templates inline in this html file if you'd like). --> <ion-nav-view></ion-nav-view> </body> </html>在 controller.js 文件的代码:
angular.module('starter.controllers', [])
.controller('LogonCtrl',function($scope,$state){ $scope.back = function(){ $state.go('carousel'); }
});在app.js文件的代码:
[javascript] view plain copy angular.module('starter', ['ionic', 'starter.controllers', 'starter.services']) .run(function($ionicPlatform) { $ionicPlatform.ready(function() { if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); cordova.plugins.Keyboard.disableScroll(true); } if (window.StatusBar) { StatusBar.styleLightContent(); } }); }) .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('logon',{ url:'/logon', templateUrl:'templates/logon.html', controller:'LogonCtrl' }); // if none of the above states are matched, use this as the fallback $urlRouterProvider.otherwise('/logon'); });在这里,我新建了一个空白html文件,定义名称为logon.html第一种是placeholder(占位符)模拟输入,当用户输入时,占位符将会隐藏在logon.html里的代码如下:
[html] view plain copy <ion-view title="登陆页面"> <ion-content> <div class="list"> <label class="item item-input"> <input type="text" placeholder="First Name"> </label> <label class="item item-input"> <input type="text" placeholder="Last Name"> </label> <label class="item item-input"> <input type="text" placeholder="password"> </label> </div> <button class="button button-full">登陆</button> </ion-content> </ion-view>接下来,第二个是内联标签,使用输入标签将标签放在输入元素的左边,当用户输入内容时标签不隐藏
在logon.html里的代码:
[html] view plain copy <ion-view title="登陆页面"><ion-content><div class="list"><label class="item item-input"><span class="input-label">Username</span><input type="text"></label><label class="item item-input"><span class="input-label">Password</span><input type="password"></label></div><button class="button button-full">登陆</button></ion-content></ion-view>第三个是堆叠标签,既使用占位符标签,也使用内联标签,当然,主要是它自身的堆叠效果(stacked)在logon.html里的代码如下:
在logon.html里的代码如下:[html] view plain copy <ion-view title="登陆页面"><ion-content><div class="list"><label class="item item-input item-stacked-label"><span class="input-label">Username</span><input type="text" placeholder="Mary"></label><label class="item item-input item-stacked-label"><span class="input-label">Password</span><input type="password"placeholder="Password"></label></div><button class="button button-full">登陆</button></ion-content></ion-view>第四种是浮动标签在logon.html里的代码如下:[html] view plain copy <ion-view title="登陆页面"><ion-content><div class="list"><label class="item item-input item-floating-label"><span class="input-label">Username</span><input type="text" placeholder="Username"></label><label class="item item-input item-floating-label"><span class="input-label">Password</span><input type="password" placeholder="Password"></label></div><button class="button button-full">登陆</button></ion-content></ion-view>第五种 插图的形式
[html] view plain copy <ion-view title="登陆页面"><ion-content><div class="list list-inset"><label class="item item-input"><input type="text"placeholder="Username"></label><label class="item item-input"><input type="password" placeholder="Password"></label></div><button class="button button-full">登陆</button></ion-content></ion-view>第六种 插入输入在logon.html里的代码如下:
[html] view plain copy <ion-view title="登陆页面"><ion-content><div class="list"><div class="item-input-inset"><label class="item-input-wrapper"><input type="text"placeholder="Username"></label></div><div class="item-input-inset"><label class="item-input-wrapper"><input type="password" placeholder="Password"></label></div></div><button class="button button-full">登陆</button></ion-content></ion-view>第七种 输入图标在logon.html里的代码如下:
[html] view plain copy <ion-view title="登陆页面"><ion-content><div class="list list-inset"><label class="item item-input"><i class="icon ion-person"></i><input type="text" placeholder="Username"></label><label class="item item-input"><i class="icon ion-locked"></i><input type="password"placeholder="Password"></label></div><button class="button button-full">登陆</button></ion-content></ion-view>第八种代码:
[html] view plain copy <ion-view><div class="bar bar-header"><div class="title">登陆</div></div><ion-view><ion-content style="margin-top: 40px"><div class="list item-input-inset"><h4>Username:</h4><label class="item item-input"><input type="text"></label></div><div class="list item-input-inset"><h4>Password:</h4><label class="item item-input"><input type="tel"></label></div><div class="list item-input-inset"><h4>Email:</h4><label class="item item-input"><input type="email"></label></div></ion-content></ion-view></ion-view>
相关文章推荐
- 这里我将分享我学到的几种ionic登陆界面
- 这里我将分享我学到的几种ionic登陆界面
- 去掉xp登陆界面的方法分享
- Flex系统登陆界面开发体会分享(二)
- ionic入门教程第七课-简要说明几种界面之间的参数传递及优缺点
- Flex系统登陆界面开发体会分享(三)上
- Flex登陆界面开发经验分享五:Flex登陆框美化
- 分享几个Android初学者做界面的时候常用到的几个layout(包括注册,登陆,设置等等)
- UI一揽子计划 20 (豆瓣实战之图片缓存 、豆瓣实战之详情界面(自适应行高) 、豆瓣实战之登陆注销、刘新林分享之UIAlertController)
- ionic入门教程第七课-简要说明几种界面之间的参数传递及优缺点
- OA中秋登陆界面分享
- 用java写一个用户登陆界面的代码分享
- ionic新手教程第七课-简要说明几种界面之间的參数传递及优缺点
- Android登陆界面采用文件存储实现
- Android 使用友盟分享SDK,分享到QQ成功后,遇到app被销毁后,回到此分享界面无法正常点击界面问题。--连QQ都忘记处理的activity状态恢复问题
- Flask入门之开发简单登陆界面
- 修改QQ2012登陆界面和Win7开机画面的方法整理(收集于互联网)
- [置顶] 简单大方的登陆界面(包括flash动画)
- java写入文件的几种方法分享
- 分享SQL语句从M条数据读取到N条的几种写法!