NewsTemplate

Introduction: 仿知乎日报新闻详细页,使用 artTemplate 引擎渲染,头部带有视觉差
More: Author   ReportBugs   
Tags:
视觉差-新闻页-

介绍

仿知乎日报新闻详情页

特性

  • artTemplate 模板引擎
  • 头部图片滚动视觉差
  • HTML 中图片绑定点击事件

步骤

编写模板

<script id="contenttpl" type="text/html">
        {{#body}}
</script>

渲染模板

<div id="contentTop"></div>
<script>
    var data =JSON.parse(window.bazhang.getNewsData());
    var html = template('contenttpl', data);
    document.getElementById('contentTop').innerHTML = html;
</script>

加载本地网页

mWebNews.loadUrl("file:///android_asset/newscont.html");

使用到的开源库

预览

Lincense

Copyright [2016] [JeasonWong of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Apps
About Me
GitHub: Trinea
Facebook: Dev Tools