帖子
帖子
用户
博客
课程
显示全部楼层
6
帖子
0
勋章
36
Y币
发表于 2019-4-5 23:57:50
10
未解决

UISearchBar模块苹果X适配问题 [复制链接]

  • 发表于:2019-04-05 23:57:50
模块是最新的版本
065002zss40wz054ccuc4s.png
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <link rel="stylesheet" type="text/css" href="../css/aui.css" />
  8. </head>
  9. <body>
  10.     <a class="button" tapmode="active" onclick="open_s()">打开搜索页面</a>
  11.     <a class="button" tapmode="active" onclick="close_s()">关闭搜索页面</a>
  12.     <a class="button" tapmode="active" onclick="setText_s()">设置搜索框的文字</a>
  13.     <a class="button" tapmode="active" onclick="clearHistory_s()">清空当前搜索历史记录</a>
  14. </body>
  15. <script type="text/javascript" src="../script/api.js"></script>
  16. <script type="text/javascript">
  17.     apiready = function() {
  18.         api.addEventListener({
  19.             name : 'shake'
  20.         }, function(ret, err) {
  21.             console.log(111);
  22.             close_s()
  23.         });
  24.     };

  25.     function open_s() {
  26.         var UISearchBar = api.require('UISearchBar');
  27.         UISearchBar.open({
  28.             placeholder: '请输入搜索关键字',
  29.             historyCount: 10,
  30.             showRecordBtn: true,
  31.             texts: {
  32.                 cancelText: '取消',
  33.                 clearText: '清除搜索记录'
  34.             },
  35.             styles: {
  36.                 navBar: {
  37.                     bgColor: '#FFFFFF',
  38.                     borderColor: '#ccc'
  39.                 },
  40.                 searchBox: {
  41.                     bgImg: '',
  42.                     color: '#000',
  43.                     height: 44
  44.                 },
  45.                 cancel: {
  46.                     bg: 'rgba(0,0,0,0)',
  47.                     color: '#D2691E',
  48.                     size: 16
  49.                 },
  50.                 list: {
  51.                     color: '#696969',
  52.                     bgColor: '#FFFFFF',
  53.                     borderColor: '#eee',
  54.                     size: 16
  55.                 },
  56.                 clear: {
  57.                     color: '#000000',
  58.                     borderColor: '#ccc',
  59.                     size: 16
  60.                 }
  61.             }
  62.         }, function(ret, err) {
  63.             if (ret) {
  64.                 alert(JSON.stringify(ret));
  65.             } else {

  66.                 alert(JSON.stringify(err));
  67.             }
  68.         });
  69.     }



  70.     function close_s() {
  71.         var UISearchBar = api.require('UISearchBar');
  72.         UISearchBar.close();
  73.     }



  74.     function clearHistory_s() {
  75.         var UISearchBar = api.require('UISearchBar');
  76.         UISearchBar.clearHistory();
  77.     }
  78. </script>
复制代码


22
帖子
1
勋章
1万+
Y币
用自定义loader编译试试,不要直接用apploader
6
帖子
0
勋章
36
Y币
handsix 发表于 2019-4-6 00:15
用自定义loader编译试试,不要直接用apploader

自定义loader编译刚试了,一样的
22
帖子
1
勋章
1万+
Y币
css自己实现吧~
42
帖子
4
勋章
1万+
Y币
先打开win  在win设置沉浸式  然后打开模块看下
您需要登录后才可以回帖 登录

本版积分规则