1

Windows 8分割アプリはタイルを表示することを知っているので、画像を表示したいのですが、各タイルではすべての画像が異なるはずです。

これが、タグがあるdefault.htmlページで私がやっていることです

<div class="item">
<img alt="some text" data-win-bind="source: imagePath">
<div class="item-overlay">
                <h4 class="item-title" data-win-bind="textContent: title"></h4>
                <h6 class="item-subtitle win-type-ellipsis" data-win-bind="textContent: subtitle"></h6>
            </div>
        </div>
    </div>

これがdata.jsファイルのコードです

var sampleGroups = [
            { key: "group1", title: "Group Title: 1", subtitle: "Group Subtitle: 1", **imagePath:"path of image file 1",** backgroundImage: darkGray, description: groupDescription },
            { key: "group2", title: "Group Title: 2", subtitle: "Group Subtitle: 2", **imagePath:"path of image file 2",** backgroundImage: lightGray, description: groupDescription },
            { key: "group3", title: "Group Title: 3", subtitle: "Group Subtitle: 3",**imagePath:"path of image file 3",** backgroundImage: mediumGray, description: groupDescription },
            { key: "group4", title: "Group Title: 4", subtitle: "Group Subtitle: 4",imagePath:"path of image file 4", backgroundImage: lightGray, description: groupDescription },
            { key: "group5", title: "Group Title: 5", subtitle: "Group Subtitle: 5", imagePath:"path of image file 5", backgroundImage: mediumGray, description: groupDescription },
            { key: "group6", title: "Group Title: 6", subtitle: "Group Subtitle: 6", **imagePath:"path of image file 6",** backgroundImage: darkGray, description: groupDescription }
        ];
4

1 に答える 1

0

これが解決策です(Usman ur Rehman氏に感謝)

data.js を開き、以下のコードに従ってコードを変更します。

function generateSampleData() { var itemContent = "

Curabitur クラス aliquam vestibulum nam curae maecenas sed...";

    // These three strings encode placeholder images. You will want to set the
    // backgroundImage property in your real data to be URLs to images.
    var darkGray =  "images/1.png";
    var lightGray = "images/1.png";
    var mediumGray = "images/1.png";

    // Each of these sample groups must have a unique key to be displayed
    // separately.
    var sampleGroups = [
        { key: "group1", title: "Group Title: 1", subtitle: "Group Subtitle: 1", backgroundImage: darkGray, description: groupDescription },
        { key: "group2", title: "Group Title: 2", subtitle: "Group Subtitle: 2", backgroundImage: lightGray, description: groupDescription },
        { key: "group3", title: "Group Title: 3", subtitle: "Group Subtitle: 3", backgroundImage: mediumGray, description: groupDescription }, .....
于 2012-11-16T18:11:31.740 に答える