国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 系統(tǒng) > Android > 正文

Android 中的兩端對(duì)齊實(shí)例詳解

2019-12-12 03:53:41
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

  在android中的webview中,可以對(duì)文本內(nèi)容進(jìn)行對(duì)齊,具體方法如下

  public class MainActivity extends Activity {     @Override   protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);       String htmlText = " %s ";     String myData = "Hello World! This tutorial is to show demo of displaying text with justify alignment in WebView.";       WebView webView = (WebView) findViewById(R.id.webView1);     webView.loadData(String.format(htmlText, myData), "text/html", "utf-8");   } } 

activity_main.xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"   xmlns:tools="http://schemas.android.com/tools"   android:layout_width="match_parent"   android:layout_height="match_parent"   tools:context=".MainActivity" >     <WebView     android:id="@+id/webView1"     android:layout_width="match_parent"     android:layout_height="match_parent"/>   </RelativeLayout> 

感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 长岭县| 攀枝花市| 鹤庆县| 得荣县| 安化县| 安丘市| 日喀则市| 奈曼旗| 清镇市| 新乡县| 类乌齐县| 临夏市| 景洪市| 府谷县| 大化| 格尔木市| 防城港市| 台山市| 东港市| 五家渠市| 驻马店市| 南丰县| 比如县| 合阳县| 绥江县| 通州区| 介休市| 新河县| 富阳市| 伊春市| 清水河县| 峡江县| 双柏县| 瑞昌市| 西吉县| 甘孜县| 伊吾县| 蒙自县| 辉县市| 方山县| 河津市|