webview中的JQuery移动UI扩展(JQuery mobile UI-scaling in webview)
目前我正在Android app中使用基于Web的模块。我使用Jquery移动设计并使用webview将其导入到android活动中。当我运行活动时,设计显示但没有缩放到webview,它包含水平和垂直scrolls。我已经附上了这篇文章的代码。我需要协助扩展jquery移动设计的活动。谢谢!
package com.example.updatesuite; import android.os.Bundle; import android.annotation.SuppressLint; import android.app.Activity; import android.view.Menu; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; @SuppressLint("SetJavaScriptEnabled") public class Gateway extends Activity { WebView wv1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_gateway); wv1=(WebView)findViewById(R.id.webView1); WebSettings webSettings = wv1.getSettings(); webSettings.setDefaultFontSize(14); wv1.getSettings().setLoadWithOverviewMode(true); wv1.getSettings().setUseWideViewPort(true); wv1.getSettings().setJavaScriptEnabled(true); wv1.getSettings().setSupportZoom(false); wv1.getSettings().setBuiltInZoomControls(false); wv1.setWebChromeClient(new WebChromeClient()); wv1.setWebViewClient(new WebViewClient()); wv1.loadUrl("http://applicationdownloader.pixub.com/walcliff/index.php"); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.gateway, menu); return true; } }
Currently i am working on a web based module in android app.I use Jquery mobile design and import it in the android activity using webview.When i run the activity,the design is displayed but not scaled to the webview,It contains horizontal and vertical scrolls.I have attached the code along with this post.I need assistance for scaling the activity of jquery mobile design.Thanks in advance!
package com.example.updatesuite; import android.os.Bundle; import android.annotation.SuppressLint; import android.app.Activity; import android.view.Menu; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; @SuppressLint("SetJavaScriptEnabled") public class Gateway extends Activity { WebView wv1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_gateway); wv1=(WebView)findViewById(R.id.webView1); WebSettings webSettings = wv1.getSettings(); webSettings.setDefaultFontSize(14); wv1.getSettings().setLoadWithOverviewMode(true); wv1.getSettings().setUseWideViewPort(true); wv1.getSettings().setJavaScriptEnabled(true); wv1.getSettings().setSupportZoom(false); wv1.getSettings().setBuiltInZoomControls(false); wv1.setWebChromeClient(new WebChromeClient()); wv1.setWebViewClient(new WebViewClient()); wv1.loadUrl("http://applicationdownloader.pixub.com/walcliff/index.php"); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.gateway, menu); return true; } }
原文:https://stackoverflow.com/questions/21413744
更新时间:2022-12-23 08:12