How to make a Scrollable Layout and Zoomable Layout in an Android App?

后端 未结 1 505
北恋
北恋 2021-01-19 22:04

I am making an Android App and i need one of my Layouts to have Zoom control and have it be Scrollable Vertical, but i don\'t know how to successfully do this?

相关标签:
1条回答
  • 2021-01-19 22:27

    use this jar in your application

    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.zoomableview, 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);            }
    
    0 讨论(0)
提交回复
热议问题