0

Web ページから HTML ソース コードを取得しています。使用するHtml.showHtml(htmlSource); と、グラフが正しく表示されません。色を付けずにウェブ上でグラフがどのように見えるかを次に示します。

Day  Date    Time    Event                          Location
Fri Sep 27  4:00 PM  Practice                   MSC Yellow
Sun Sep 29  3:00 PM MJBL Game vs Runnin Rebels  MSC Yellow

グラフの html と css は次のとおりです。

    <table class="gymschedule">
    <colgroup>
        <col />
        <col />
        <col />
        <col />
        <col width="10" /> <!-- small! -->
        <col />
        <col />
    </colgroup>
    <thead>

                    <tr>
            <td>
                <nobr>Fri</nobr>
            </td>
            <td>
                <nobr>Nov 1</nobr>
            </td>
            <td>
                <nobr>4:00 PM</nobr>
            </td>
            <td>
                Practice                </td>
            <td>
                <nobr>MSC Yellow</nobr>
            </td>
        </tr>
                    <tr>
            <td>
                <nobr>Fri</nobr>
            </td>
            <td>
                <nobr>Nov 8</nobr>
            </td>
            <td>
                <nobr>4:00 PM</nobr>
            </td>
            <td>
                Practice                </td>
            <td>
                <nobr>MSC Yellow</nobr>
            </td>
        </tr>
                </tbody>
</table>

Androidフォンでこのグラフをテキストまたは画像ビューで正しく表示するにはどうすればよいですか?

4

1 に答える 1

0

<table>Android TextView は、タグとそれに関連付けられたタグをサポートしていません。TextView でサポートされている HTML タグの一覧については、こちらを参照してください。

これを表示するには、WebView を使用する必要があります。まず、レイアウトに WebView を追加します。

<WebView
    android:id="@+id/webView"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />

次に、関連するアクティビティにテーブル HTML をロードします。

String html = "<table> ..... </table>";

WebView webView = (WebView)findViewById(R.id.webView);
webView.loadData(html, "text/html", "utf-8");
于 2013-10-10T05:04:41.710 に答える