• Easily understand the viewport of WebView in IOS 11


    IOS 11 brings some new, perhaps non intuitive behavior in the status bar area, which is particularly important for developers using tools such as Apache Cordova or ionic. In particular, this behavior change will affect any web-based application that uses fixed to locate the title bar when building IOS 11. This article helps you understand […]

  • Android WebView implements top progress bar


    WebView and progress bar are used at the top of the project to let users know the loading progress and improve the user experience effect: Layout: <RelativeLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical”> <WebView android:id=”@+id/webView” android:layout_width=”match_parent” android:layout_height=”match_parent” android:layout_below=”@+id/toolbar_container” /> <ProgressBar android:id=”@+id/progressBar” style=”@style/crowd_item_progressBar” android:layout_width=”match_parent” android:layout_height=”3dp” android:layout_below=”@+id/toolbar_container” android:background=”@drawable/crowd_progressbar_unselect” /> </RelativeLayout> Progress bar style: <style name=”crowd_item_progressBar”> <item name=”android:indeterminateOnly”>false</item> <item name=”android:progressDrawable”>@drawable/crowd_progressbar_background</item> <item […]

  • Android uses WebView to realize the function of full screen switching and playing web video


    First write the layout file activity_ main.xml : <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:id=”@+id/container” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical”> <FrameLayout android:id=”@+id/video_view” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:visibility=”gone” ></FrameLayout> <Button android:id=”@+id/video_landport” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:text= “Do not display this button in full screen, click to switch to horizontal screen” android:gravity=”center” /> <WebView android:id=”@+id/video_webview” android:layout_width=”fill_parent” android:layout_height=”fill_parent” /> </LinearLayout> Principle: when realizing full screen, put the […]

  • Solution of local cache problem of H5 WebView embedded in app


    Above It’s very common to embed H5 in apps, but the WebView provided by each app is not the same. In the development process, we encounter a very difficult caching problem. The H5 code of our mall project is loaded when the app starts, and then the index.html The file is cached locally.Take notes Problem […]

  • How WebView adapts H5 to upload photos or video files


    1、 Functions to be realized: In the app implemented with H5, you need to get photos or video files from the mobile phone in H5 and upload them to the server.   2、 Analysis and implementation method: Because I don’t understand the front-end development, I don’t know that there are label controls such as input […]

  • Implementation of HTML5 WebView element location tool


    1、 Tool selection There are three ways to locate WebView elements: use driver.page_ Source method: write the obtained page content into an HTML file, then open the HTML file with browser, and locate the element using F12 debugging tool Developer tools, a debugging tool provided with the Chrome browser, can be input into the Chrome […]

  • Android WebView supports input file to enable camera / photo selection


    To enable input file photographing or selecting file function in WebView, you can click webview.setWebChromeClient Method to intercept the WebView input event and do our corresponding operations. Android code webView.setWebChromeClient(new WebChromeClient() { @Override public void onProgressChanged(WebView view, int newProgress) { if (newProgress == 100) { progressBar.setVisibility ( View.GONE ); // after loading, the progress bar […]

  • IOS wkwebview cannot handle URL scheme and app store links


    Introduction to wkwebview Uiwebview comes from ios2 and wkwebview comes from ios8. There is no doubt that wkwebview will gradually replace the cumbersome uiwebview. Through a simple test, we can find that uiwebview takes up too much memory, and the memory peak is even more exaggerated. The loading speed of wkwebview web page has also […]

  • Example code for flutter to realize combination and sliding of WebView and native components


    Recently, we are writing a news client with flutter. The content in the news detail page needs to be displayed with flutter’s local widget and WebView together. For example, the video player above the title / uses local widget to display, and the rich text of news content uses WebView to display HTML, which requires […]

  • H5 (Vue) nested IOS and Android two-way interaction


    Before the joint debugging with the client, I didn’t pay attention to the details. In this development, I encountered joint debugging again. I sorted it out uniformly, and then I encapsulated a set of basic code myselfPay attention to AndroidThe following situation — Android does not have parameters, so does H5. Android needs parameters, so […]

  • An example of how to accurately calculate the height of WebView in IOS


    Preface In the process of developing app, it is inevitable to meet the demand of loading WebView into the cell of tableview. Generally, this problem is encountered. The common idea is to get the height of WebView in WebView’s callback method webviewdidfinishload, refresh tableview, and assign the height to the callback method heightforrow of tableview. […]

  • The method of using webp format picture in IOS WebView


    Webp format picture Webp image is introduced by Google. Compared with JPG PNG, it has a huge advantage. Images with the same quality take up less space. In an app with more pictures, such as e-commerce, it will have a great advantage to use webp images. Introduction Webp format has been used in our project […]