Zoomable pictures are only supported in Webview and Mapview. So first we have to create a Webview layout with zoom controls in it.
First copy the picture in to the assets folder
Then, Copy the following code in to activity_main.xml file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MapActivity" >
<ZoomControls
android:id="@+id/zoomControls1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="52dp"
android:layout_marginRight="20dp" />
<WebView
android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
/>
</RelativeLayout>
Now vopy the following code in the oncreate method,in ActivityMain.Java file
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
// Show the Up button in the action bar.
//getActionBar().setDisplayHomeAsUpEnabled(true);
WebView WV = (WebView)findViewById (R.id.webView1);
WV.loadUrl("file:///android_asset/kerala.jpg");
WV.getSettings().setBuiltInZoomControls(true);
WV.getSettings().setSupportZoom(true);
}
You are done.Dont forget to replace the kerala.jpg file name with your filename of picture. Just run the application yoiu will find the picture as zoomable.
This blog is created to help you in Android Development.This will be helpful to Beginners as well as Experiencing Developers. For easy understanding screen shots and graphics are widely used.To further help you, links to useful Android resources and an Exclusive search in best Android forums is given. In contrast to other Android sites many shortcuts and very useful tips are also given. You may post your feedback, syntax, tips and shortcuts as comments.
Thursday, March 21, 2013
e. How to give a zoomable picture in an Application
Android Development Help
e. How to give a zoomable picture in an Application
Subscribe to:
Post Comments (Atom)
Zoomable picture is good fun and android application developers can develop this according to the requirement. This xml file help for the same one. Great one.
ReplyDeleteThis is very interesting post, keep more sharing. Website Designing Company Bangalore | Web Designing Company Bangalore
ReplyDeleteThanks for sharing this information. your blog is good and I got so much knowledge. Please visit https://goo.gl/Za2Qf4
ReplyDeletehello,
ReplyDeletei just want to say that you have clearly mention the process very clearly and i also found it is very much easy
to understand. keep sharing.
ios app development company in chennai
Great post. I was checking continuously this blog and I am impressed! I enjoyed reading your post. Please continue publishing helpful information like this. I like this type of information and share my opinion with you.Digital Marketing Company in India | Travel Technology Software | Software Development Solutions in India | Web Design Services in India | Mobile App Developer Noida
ReplyDeleteThe using this method cheap essay does not require any special skills for a successful completion. The scalable image easily becomes noticeable thanks to this.
ReplyDeleteThis is a fantastic idea! I like it a lot because it's super easy for the audience to see the value of opting in. wonderful and amazing post very use full your post thanks for sharing your article
ReplyDeleteBest training institute in Noida
Best Python django training institute in Noida
Best Artificial Intelligence training institute in Noida
Best Machine Learning training institute in Noida
Best Business Analyst training institute in Noida
Best Data Science training institute in Noida
Best Software Testing training institute in Noida
Best Data Analyst training institute in Noida
Wow Very Nice Post I really like This Post. Please share more post.
ReplyDeletePlant Engineering Services
Offshore Engineering Services India
Great share! Thanks for the information. Keep going1
ReplyDelete