Ginso
Ginso

Reputation: 569

android make my LinearLayout zoomable

i have a LinearLayout, wrapped in a ScrollView, that contains mostly TextViews and sometimes ImageViews. Now i want to give the user the possibility to zoom in(and out again) with two fingers. Is there an easy way to do that? Here is the extract from the xml-file:

<ScrollView
    android:background="@color/transparent"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="top">

    <LinearLayout
        android:background="@color/transparent"
        android:id="@+id/layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_gravity="top|center_horizontal"></LinearLayout>
</ScrollView>

Upvotes: 0

Views: 1604

Answers (1)

User
User

Reputation: 4221

Use ZoomView

It will provide functionality to zoom layout by pinch.

ZoomView zoomView = new ZoomView(this);
zoomView.addView(layout);

Upvotes: 1

Related Questions