大佬教程收集整理的这篇文章主要介绍了android – 在webview中显示重音字符,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我提供了代码来演示:
public class MainActivity extends Activity { private WebView webView; private EditText edittext_1; private Button buttonupdate; @Override public void onCreate(Bundle savedInstanceStatE) { super.onCreate(savedInstanceStatE); setContentView(R.layout.activity_main); webView = (WebView) findViewById(R.id.webview_sumMary); webView.getSetTings().setJavaScriptEnabled(true); edittext_1 = (EditText) findViewById(R.id.editText_1); buttonupdate = (Button) findViewById(R.id.button_updatE); buttonupdate.setOnClickListener(new View.onClickListener() { public void onClick(View v) { String s = edittext_1.getText().toString(); webView.loadData(s,"text/html","utf-8"); } }); } @Override public Boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main,menu); return true; } }
XML:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://scheR_461_11845@as.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <WebView android:id="@+id/webview_sumMary" android:layout_width="fill_parent" android:layout_height="0px" android:layout_weight=".85" /> <LinearLayout xmlns:android="http://scheR_461_11845@as.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="0px" android:layout_weight=".15" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" > <EditText android:id="@+id/editText_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:hint="text" android:minWidth="100dp" android:text="" /> <Button android:id="@+id/button_update" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/editText_1" android:padding="10dp" /> </RelativeLayout> </LinearLayout> </LinearLayout>
以上是大佬教程为你收集整理的android – 在webview中显示重音字符全部内容,希望文章能够帮你解决android – 在webview中显示重音字符所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。