【问题标题】:How to make a Scrollable Layout and Zoomable Layout in an Android App?如何在 Android 应用中制作可滚动布局和可缩放布局?
【发布时间】:2011-01-23 06:05:31
【问题描述】:

我正在制作一个 Android 应用程序,我需要我的一个布局来进行缩放控制并使其成为可垂直滚动,但我不知道如何成功地做到这一点?

【问题讨论】:

  • 请澄清您所说的“具有缩放控制的布局”是什么意思。

标签: android


【解决方案1】:

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);            }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-08
    • 2016-12-02
    • 2017-08-23
    • 1970-01-01
    • 2019-02-05
    • 1970-01-01
    • 2016-11-05
    相关资源
    最近更新 更多