Skip to content

Commit

Permalink
[update]:[update README,更新CustomWebview的教程]
Browse files Browse the repository at this point in the history
  • Loading branch information
leijie committed Jul 28, 2023
1 parent 000ef27 commit 44f5c65
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,22 @@ for example:

will print 'JS got a message hello' and 'JS responding with' in webview console.

### Switch to CustomWebview
* activity_main.xml
```xml
<com.github.lzyzsd.jsbridge.example.CustomWebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</com.github.lzyzsd.jsbridge.example.CustomWebView>
```
* MainActivity.java
Class BridgeWebview change to CustomWebview;
```java
CustomWebView webView = (CustomWebView) findViewById(R.id.webView);

```

## Notice

This lib will inject a WebViewJavascriptBridge Object to window object.
Expand Down

0 comments on commit 44f5c65

Please sign in to comment.