首页 技术 正文
技术 2022年11月8日
0 收藏 747 点赞 1,917 浏览 1101 个字

闲话不说,先上图:

ionic第二坑——ionic 上拉菜单(ActionSheet)安卓样式坑

这是IOS上的显示效果,代码如下:

HTML部分:

 <body ng-app="starter" ng-controller="actionsheetCtl" >
<ion-pane>
<ion-content >
<h2 ng-click="show()">Action Sheet</h2>
</ion-content>
</ion-pane>
</body>

JS部分:

 angular.module('starter', ['ionic']) .run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
}) .controller( 'actionsheetCtl',['$scope','$ionicActionSheet','$timeout' ,function($scope,$ionicActionSheet,$timeout){
$scope.show = function() {
var hideSheet = $ionicActionSheet.show({
buttons: [
{ text: '<b>Share</b> This' },
{ text: 'Move' }
],
destructiveText: 'Delete',
titleText: 'Modify your album',
cancelText: 'Cancel',
cancel: function() {
// add cancel code..
},
buttonClicked: function(index) {
return true;
}
});
};
}])

可是,当把以上代码写进项目后,安卓上打包后却不是如此,如下图:

ionic第二坑——ionic 上拉菜单(ActionSheet)安卓样式坑

就变成了这个鬼样子。。。什么原因呢?于是查看样式,对比后发现,android平台应用这段代码时候,会多出一段样式:

ionic第二坑——ionic 上拉菜单(ActionSheet)安卓样式坑ionic第二坑——ionic 上拉菜单(ActionSheet)安卓样式坑

原来,就是这部分样式导致了不正常的菜单出现。不知道框架为什么做如此处理,但于我们而言这样明显是不行的,于是乎修改ionic.css,如下:

ionic第二坑——ionic 上拉菜单(ActionSheet)安卓样式坑

把这段css代码注释掉就可以了,目前还没有其他影响。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,490
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,905
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,738
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,491
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,129
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,292