请参阅以下Webview代码- Webview.java
public class webView extends AppCompatActivity {
public WebView webView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web_view);
webView = (WebView)findViewById(R.id.webview);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("https://ewaybillgst.gov.in/Account/EWBUserRegistration.aspx");
}
}
Webview.xml
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp"
android:id="@+id/webview"
/>
请告诉我,如何将该URL完全加载到手机屏幕内,以使其不会移到外部。 查看手机屏幕的此屏幕截图- webview is moving to right side of phone's screen so we have to drag it to see whats on the right side
我希望此页面不会移到手机屏幕之外。
答案 0 :(得分:0)
尝试
webView.getSettings().setLoadWithOverviewMode(true); //loads the WebView completely zoomed out