Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to zoom in the bus route map
    primarykey
    data
    text
    <p>i have a bus route map as an image. using the zoom controller the image is zooming out but not zooming in please look at my code and let me know the change to be done make it working.. i am developing my app on Gingerbread i.e API 10</p> <pre><code>import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.ZoomControls; public class Busmaps extends Activity { ImageView img; ZoomControls zoom; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.busmaps); img = (ImageView) findViewById(R.id.imageViewmaps1); zoom = (ZoomControls) findViewById(R.id.zoomControls1); zoom.setOnZoomInClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub int w = img.getWidth(); int h = img.getHeight(); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(w + 50, h + 50); params.addRule(RelativeLayout.CENTER_IN_PARENT); img.setLayoutParams(params); } }); zoom.setOnZoomOutClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub int w = img.getWidth(); int h = img.getHeight(); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(w - 50, h - 50); params.addRule(RelativeLayout.CENTER_IN_PARENT); img.setLayoutParams(params); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.bus_map_zoom, menu); return true; } } </code></pre> <p>my xml says for bus route image:-</p> <pre><code>&lt;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" &gt; &lt;ImageView android:id="@+id/imageViewmaps1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:src="@drawable/map" /&gt; &lt;ZoomControls android:id="@+id/zoomControls1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>how should i make my zoom control working for both Zoom in and Zoom out.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload