当前位置: 移动技术网 > IT编程>移动开发>Android > Android 中的两端对齐实例详解

Android 中的两端对齐实例详解

2019年07月24日  | 移动技术网IT编程  | 我要评论

花倾国,4948很太吧h小游戏,废纸粉碎机

  在android中的webview中,可以对文本内容进行对齐,具体方法如下

  
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> 

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网