2013-09-22 2 views
0

웹 페이지에서 일부 HTML 소스 코드를 가져옵니다. Html.showHtml(htmlSource); 을 사용할 때 그래프가 올바르게 표시되지 않습니다. 나는 텍스트 또는 이미지에이 그래프를 표시 할 수있는 방법Android show textview graph

<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> 

: 여기

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입니다 : 여기 그래프는 착색하지 않고, 웹 모습입니다 안드로이드 폰에서 올바르게보기?

답변

0

Android TextView는 <table> 태그 및 관련 태그를 지원하지 않습니다. TextView에서 지원하는 HTML 태그 목록은 here을 참조하십시오.

이것을 표시하려면 WebView를 사용해야합니다. 먼저, 레이아웃에 웹보기를 추가

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

WebView webView = (WebView)findViewById(R.id.webView); 
webView.loadData(html, "text/html", "utf-8"); 
:

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

그런 다음 관련 활동의 테이블 HTML을로드