Corey Posted March 11, 2013 Share Posted March 11, 2013 (edited) So I am working on a simple android application and on one of my pages I am going to have a map of my campus. I want to be able to use the pinch to zoom feature to zoom in on the picture and look at it closer. Here is the imageview <ImageView android:id="@+id/imageCampusMap" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:contentDescription="@string/map_description" android:gravity="center" android:src="@drawable/map" /> My Activity Java file just opens up the xml. public class CampusMap extends Activity { // Open the layout for the CampusMap Activity @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_campusmap); } } I thought it would be a simple task to just insert some code to pinch to zoom, but after spending some time googling I came across a large amount of code in order to do this. It was kind of confusing to look at hence why I came here Like I found an example here - http://stackoverflow.com/questions/6758847/pinch-zoom-in-android-for-an-imageview The solution uses something like public class MyImageView extends View { How would my Activity Java file call this view class? That is what was confusing me. Or would this replace my previous activity java file mentioned earlier? Edited March 11, 2013 by Corey Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.