Wiki about android-zoom-view.jar

心已入冬 提交于 2019-12-19 07:48:32

问题


Is there any Wiki or any documents on how to implement android-zoom-view.jar. I found it on http://code.google.com/p/android-zoom-view/ and i wanna try to use it on my application to implement zooming on android scrollview but it's giving me a hard time to do it since i cant find any Wiki about it.

Any comments or suggestions are very much appreciated.

Thanks in advance


回答1:


I wanna share my code on how to use the android-zoom-view.jar. This is how I use it.

  1. Create a new layout (R.layout.zoomable_view) for Views that i want to apply the zooming functionality.
  2. Place it inside ZoomView.
  3. Then place the ZoomView to the main container where you want to show the zoomable view.

    private ZoomView zoomView;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_zoomable);
    
       View v = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.zoomable_view, null, false);
       v.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
    
       zoomView = new ZoomView(this);
       zoomView.addView(v);
    
       main_container = (LinearLayout) findViewById(R.id.main_container);
       main_container.addView(zoomView);            
    }
    

I hope this will help others.




回答2:


When looking at the project, you can assume that it is not used (very) much. Therefore, looking for official documentation (no Javadoc is used in the source...) or tutorials seems pointless.

So you have to do it yourself, so check out the only java source file the project has, it does not look to difficult to use:

  • Notice that the class extends the FrameLayout class, so you can assume it will behave as a regular FrameLayout. So check out FrameLayout related tutorials.
  • Focus on the public methods, as it defines the 'API' of the Zoomlayout


来源:https://stackoverflow.com/questions/14254076/wiki-about-android-zoom-view-jar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!