2017-05-06 12 views
0

私は自分のアプリケーションにWebViewを持っています。私はその中のテキストを右から左に揃えたい。私が追加してみました:アンドロイドウェブビューのテキストを右揃え

 <WebView 
     android:id="@+id/content" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:gravity="right" 
     android:layout_margin="@dimen/spacing_xsmall" /> 

これは私のコード

<LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@android:color/white" 
     android:orientation="vertical" 
     android:padding="@dimen/spacing_middle" 
     android:visibility="visible"> 

     <TextView 
      android:id="@+id/category" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="end" 
      android:background="@color/colorAccentLight" 
      android:paddingBottom="@dimen/spacing_xsmall" 
      android:paddingLeft="@dimen/spacing_medium" 
      android:paddingRight="@dimen/spacing_medium" 
      android:paddingTop="@dimen/spacing_xsmall" 
      android:text="Category" 
      android:textAllCaps="true" 
      android:textAppearance="@style/TextAppearance.AppCompat.Body1" 
      android:textColor="@android:color/white" /> 

    </LinearLayout> 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/grey_soft" 
     android:paddingBottom="@dimen/spacing_large" 
     android:paddingTop="@dimen/spacing_middle"> 

     <WebView 
      android:id="@+id/content" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_margin="@dimen/spacing_xsmall" /> 

    </RelativeLayout> 

である。しかし、これは私のために動作しません。 textviewは正常に動作しますが、WebViewは機能しませんか? 問題を解決する方法

ありがとうございます。

答えて

0

Androidのwebviewは、Webページの表示に使用されます。 Webページにそのままデータを表示します。

ウェブページのテキストの配置を変更したい場合は、ウェブページからアクセスする必要があります(アクセス権がある場合)。

関連する問題