欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android 中的兩端對齊實例詳解

 更新時間:2017年01月24日 09:06:59   投稿:lqh  
這篇文章主要介紹了Android 中的兩端對齊實例詳解的相關(guān)資料,需要的朋友可以參考下

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

  
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> 

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

相關(guān)文章

  • Android應(yīng)用的Material設(shè)計的布局兼容性的一些要點總結(jié)

    Android應(yīng)用的Material設(shè)計的布局兼容性的一些要點總結(jié)

    這篇文章主要介紹了Android應(yīng)用的Material設(shè)計的布局兼容性的一些要點總結(jié),文中還給了一個RecyclerView布局管理的例子,需要的朋友可以參考下
    2016-04-04
  • Android實現(xiàn)登錄界面的注冊功能

    Android實現(xiàn)登錄界面的注冊功能

    這篇文章主要為大家詳細(xì)介紹了Android實現(xiàn)登錄界面的注冊功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-04-04
  • Android編程UI設(shè)計之GridView和ImageView的用法

    Android編程UI設(shè)計之GridView和ImageView的用法

    這篇文章主要介紹了Android編程UI設(shè)計之GridView和ImageView的用法,結(jié)合實例形式較為詳細(xì)的分析了Android中GridView和ImageView組件的相關(guān)方法使用技巧,需要的朋友可以參考下
    2016-01-01
  • Android中系統(tǒng)自帶鎖WalkLock與KeyguardLock用法實例詳解

    Android中系統(tǒng)自帶鎖WalkLock與KeyguardLock用法實例詳解

    這篇文章主要介紹了Android中系統(tǒng)自帶鎖WalkLock與KeyguardLock用法,結(jié)合實例形式較為詳細(xì)的分析了WalkLock與KeyguardLock的功能、作用、使用方法與相關(guān)注意事項,需要的朋友可以參考下
    2016-01-01
  • Android創(chuàng)建簡單發(fā)送和接收短信應(yīng)用

    Android創(chuàng)建簡單發(fā)送和接收短信應(yīng)用

    收發(fā)短信應(yīng)該是每個手機最基本的功能之一了,即使是許多年前的老手機也都會具備這項功能,而Android 作為出色的智能手機操作系統(tǒng),自然也少不了在這方面的支持。今天我們開始自己創(chuàng)建一個簡單的發(fā)送和接收短信的應(yīng)用,需要的朋友可以參考下
    2016-04-04
  • Android實現(xiàn)Camera2預(yù)覽和拍照效果

    Android實現(xiàn)Camera2預(yù)覽和拍照效果

    這篇文章主要為大家詳細(xì)介紹了Android開發(fā)之一個類實現(xiàn)Camera2預(yù)覽和拍照效果,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2017-10-10
  • Android編程實現(xiàn)自定義toast示例

    Android編程實現(xiàn)自定義toast示例

    這篇文章主要介紹了Android編程實現(xiàn)自定義toast,結(jié)合簡單實例形式分析了自定義布局toast核心實現(xiàn)技巧,具有一定參考借鑒價值,需要的朋友可以參考下
    2017-01-01
  • Android基礎(chǔ)入門之dataBinding的簡單使用教程

    Android基礎(chǔ)入門之dataBinding的簡單使用教程

    DataBinding 是谷歌官方發(fā)布的一個框架,顧名思義即為數(shù)據(jù)綁定,下面這篇文章主要給大家介紹了關(guān)于Android基礎(chǔ)入門之dataBinding的簡單使用,文中通過實例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2022-06-06
  • Android列表對話框用法實例分析

    Android列表對話框用法實例分析

    這篇文章主要介紹了Android列表對話框用法,實例分析了Android實現(xiàn)列表對話框的布局、設(shè)置及功能等相關(guān)技巧,具有一定參考借鑒價值,需要的朋友可以參考下
    2015-09-09
  • Android Studio開發(fā)環(huán)境搭建教程詳解

    Android Studio開發(fā)環(huán)境搭建教程詳解

    android studio是最近比較火的開發(fā),那么android studio開發(fā)環(huán)境怎么搭建呢?下面通過本文給大家記錄下Android Studio開發(fā)環(huán)境搭建教程詳解,需要的朋友參考下吧
    2017-11-11

最新評論