问题
How to make zoomable LinearLayout?
I used this to zoom my layout this worked for click to zoom and not for pinch to zoom and also i want to zoom a view over this layout. That view is returned by canvas method that is used to draw a line over this layout. Now my layout is zooming and not the canvas element. Can someone help me to zoom both the canvas element and the layout. Thanks in advance buddy.
回答1:
This Answer is to zoom image and content made to load in webview
Copy an Image in Assets and create a file image.html in assets the code will be some what like this
<html>
<table>
<tr>
<td>
<img src="droid.jpg" width="304" height="228" alt="Hello">
</td>
</tr>
</table>
</html>
and write the below code in java class
public class MainActivity extends Activity {
// declare a WebView object first
WebView mWebView = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// load view
mWebView = (WebView)findViewById(R.id.webView);
// (*) this line make uses of the Zoom control
mWebView.getSettings().setBuiltInZoomControls(true);
// simply, just load an image
mWebView.loadUrl("file:///android_asset/image.html");
}
}
if you want some other option you can go to this link good luck :)
来源:https://stackoverflow.com/questions/18508850/zoom-a-view-over-layout-in-android