如何使一个滚动的布局和可缩放的布局一个Android应用程序? [英] How to make a Scrollable Layout and Zoomable Layout in an Android App?
本文介绍了如何使一个滚动的布局和可缩放的布局一个Android应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想提出一个Android应用程序,我需要我的布局之一,具有缩放控制,并让它成为垂直滚动,但我不知道如何成功地做到这一点?
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?
推荐答案
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); }
这篇关于如何使一个滚动的布局和可缩放的布局一个Android应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文