惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
MyScale Blog
MyScale Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
雷峰网
雷峰网
罗磊的独立博客
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
博客园 - 司徒正美
Last Week in AI
Last Week in AI
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
量子位
宝玉的分享
宝玉的分享

Giscafer's blog

博客停更说明 使用 ViewContainerRef 探索Angular DOM操作 GIS520论坛关闭停止运营 ionic3之组件封装篇 ionic3之图片选择插件com.synconset.imagepicker ionic3开发遇到的一些问题及解决方法 ionic3之自定义tabs菜单图标 Hexo博客畅言评论插件试用 从GISer到互联网前端工程师,JUST DO IT angular实现IM聊天图片发送 Cafe主题v1.0发布 React搭建百度前端技术学院习题演示SPA react-ponitor React 与 Redux 实践 —— 城市筛选面板 1.Two Sum 如何组件化开发WebGIS系统 2016年末总结 代码理解React组件生命周期过程 hexo-theme-cafe
ionic3 之Android的actionsheet渲染和ios一致
2017-06-19 · via Giscafer's blog

Android的action-sheet是比较丑,默认几乎不带样式,如果不给图标的话。如图:

首先对比一下ios和android样式的区别,然后在ionic.css文件中,将ios的action-sheet样式拷贝出来,独立为actionsheet.scss,这样就可以覆盖了。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

/**

* 覆盖action-sheet样式

*

**/

.action-sheet-md {

text-align: center;

}

.action-sheet-md .action-sheet-container {

padding: 0 10px;

background: none;

}

.action-sheet-md .action-sheet-group {

overflow: hidden;

margin-bottom: 8px;

border-radius: 13px;

background: #f9f9f9;

}

.action-sheet-md .action-sheet-group:last-child {

margin-bottom: 10px;

}

.action-sheet-md .action-sheet-title {

text-align: center;

padding: 1.5rem;

border-bottom: 0.55px solid #d6d6da;

border-radius: 0;

font-size: 1.3rem;

font-weight: 400;

color: #8f8f8f;

}

.action-sheet-md .action-sheet-button {

margin: 0;

padding: 18px;

min-height: 5.6rem;

border-bottom: 0.55px solid #d6d6da;

font-size: 2rem;

color: #007aff;

background: transparent;

.button-inner {

display: -webkit-flex;

display: -ms-flexbox;

display: flex;

-webkit-flex-flow: row nowrap;

-ms-flex-flow: row nowrap;

flex-flow: row nowrap;

-webkit-flex-shrink: 0;

-ms-flex-negative: 0;

flex-shrink: 0;

-webkit-align-items: center;

-ms-flex-align: center;

align-items: center;

-webkit-justify-content: center;

-ms-flex-pack: center;

justify-content: center;

width: 100%;

height: 100%;

}

}

.action-sheet-md .action-sheet-button:last-child {

border-bottom-color: transparent;

}

.action-sheet-md .action-sheet-button.activated {

margin-top: -0.55px;

border-top: 0.55px solid #ebebeb;

border-bottom-color: #ebebeb;

background: #ebebeb;

}

.action-sheet-md .action-sheet-selected {

font-weight: bold;

background: #fff;

}

.action-sheet-md .action-sheet-destructive {

color: #f53d3d;

}

.action-sheet-md .action-sheet-cancel {

font-weight: 600;

background: #fff;

}

最终效果如图:

其实ionic支持指定UI渲染模式,config设置modeios即可

推荐文章