【问题标题】:Tizen Wearable app buttons not clickableTizen 可穿戴应用程序按钮不可点击
【发布时间】:2015-12-14 14:13:07
【问题描述】:

我在漫画游戏中创建了两个类似于按钮的 href。我正在关注这个tutorial。我遇到的问题是链接不可点击。他们不响应触摸,单击时没有任何反应。

这是项目结构:

这是我的styles.css:

  * {
    font-family: Verdana, Lucida Sans, Arial, Helvetica, sans-serif;
}

body {
    margin: 0px auto;
    background-color:#0a3003;
}

img {
    margin:0px;
    padding:0px;
    border:0px;
    width:100%;
    height:auto;
    display:block;
    float:left;

}

.btn {
  display: inline-block;
  padding: 15px 4% 15px 4%;
  margin-left: 1%;
  margin-right: 1%;
  margin-top: 5px;
  margin-bottom: 5px;
  font-size: 30px;
  text-align: center;
  vertical-align: middle;
  border: 0;
  color: #ffffff;
  background-color: #4b4237;
  width: 40%;
  height: 80px;
  text-decoration: none;
}

现在我将向您展示按钮不可点击的 index.html

    <!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width,user-scalable=no">
    <title>2nd Race</title>
    <link rel="stylesheet" href="lib/tau/wearable/theme/default/tau.min.css">
    <link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)" href="lib/tau/wearable/theme/default/tau.circle.min.css">
    <!-- load theme file for your application -->
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <div>
        <div>
        <img src="images/coverpage.png" alt="Cover Page"/>
        </div>
        <div>
            <a href="#" class="btn" >&lt;&lt;</a>
            <a href="comic/page1.html" class="btn" >&gt;&gt;</a>
        </div>

    </div>
    <script type="text/javascript" src="lib/tau/wearable/js/tau.min.js"></script>
    <script type="text/javascript" src="js/circle-helper.js"></script>
    <script src="app.js"></script>
    <script src="lowBatteryCheck.js"></script>
</body>
</html>

当我将程序加载到 tizen 可穿戴仿真器上时,它看起来像这样,但没有什么是可点击的:

【问题讨论】:

    标签: html css tizen tizen-wearable-sdk


    【解决方案1】:

    在我看来, 如果你想使用 tau.js 库在页面之间移动,你需要遵循他们的规则。这是一些参考指南。
    https://developer.tizen.org/development/ui-practices/web-application/tau/hello-world#fill_content

    可能出现这个问题是因为你没有定义 TAU 的“页面”。
    这很简单。只需在根

    标签中插入 class="ui-page"。
    我使用 Tizen IDE 在我的桌面上进行了测试。在您的 index.html 中,
    <!DOCTYPE html>
    <html>
      <head>
        <meta name="viewport" content="width=device-width,user-scalable=no">
        <title>2nd Race</title>
        <link rel="stylesheet" href="lib/tau/wearable/theme/default/tau.min.css">
        <link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)" href="lib/tau/wearable/theme/default/tau.circle.min.css">
        <!-- load theme file for your application -->
        <link rel="stylesheet" href="css/style.css">
      </head>
      <body>
        <div class="ui-page">
          <div class="ui-content">
            <img src="images/coverpage.png" alt="Cover Page"/>
            <div>
              <a href="#" class="btn">&lt;&lt;</a>
              <a href="comic/page1.html" class="btn">&gt;&gt;</a>
            </div>
          </div>
        </div>
        <script type="text/javascript" src="lib/tau/wearable/js/tau.min.js"></script>
        <script type="text/javascript" src="js/circle-helper.js"></script>
        <script src="app.js"></script>
        <script src="lowBatteryCheck.js"></script>
      </body>
    </html>
    

    在所有其他页面上(comic/page1.html、page2.html...等)

    <!DOCTYPE html>
    <html>
      <body>
        <div class="ui-page">
          <div class="ui-content">
            <img src="../images/page1.png" alt="Page 1" />
            <div>
              <a href="../index.html" class="btn" >&lt;&lt;</a>
              <a href="page2.html" class="btn" >&gt;&gt;</a>
            </div>
          </div>
        </div>
        <script type="text/javascript" src="../../lib/tau/wearable/js/tau.min.js"></script>
      </body>
    </html>
    

    请用上面我的例子再试一次。
    我检查了该项目现在运行良好:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-03
      • 1970-01-01
      • 1970-01-01
      • 2019-12-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多