Tizen可穿戴应用程序按钮无法点击

时间:2015-12-14 14:13:07

标签: html css tizen tizen-wearable-sdk

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

这是项目结构:

enter image description here

这是我的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可穿戴模拟器时,它看起来像这样,但没有任何东西可以点击:

enter image description here

1 个答案:

答案 0 :(得分:0)

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

也许出现这个问题是因为你没有定义TAU的“页面” 这很简单。只需在root&lt; div&gt;中插入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>

在其他所有页面上(漫画/ 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>

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