Java 点击android放大图像

Java 点击android放大图像,java,android,Java,Android,我正在开发一个Android应用程序。 正如您在所附屏幕截图中看到的,我有一个小尺寸的ImageView。我是从毕加索图书馆下载的。现在,我想通过onClick事件在一个新的ImageViewmore-large(id:放大图像,in.XML)中放大它。我到处寻找解决方案,也通过Android网站的指南,但我不知道如何实现它。有人能帮我吗?谢谢 尝试使用Githubcreate new activity中的chrisbanes.photoview创建新活动,然后单击image将图像路径发送到

我正在开发一个Android应用程序。 正如您在所附屏幕截图中看到的,我有一个小尺寸的
ImageView
。我是从毕加索图书馆下载的。现在,我想通过onClick事件在一个新的
ImageView
more-large(id:放大图像,in.XML)中放大它。我到处寻找解决方案,也通过Android网站的指南,但我不知道如何实现它。有人能帮我吗?谢谢



尝试使用Githubcreate new activity中的
chrisbanes.photoview
创建新活动,然后单击image将图像路径发送到新创建的活动并显示图像。
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:andorid="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <LinearLayout
            android:id="@+id/viewA"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="0.65"
            android:orientation="horizontal">

            <ImageView
                android:id="@+id/img_poster_film"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:clickable="true"
                android:scaleType="centerCrop"
                app:srcCompat="@drawable/ic_star_rate_black_18dp" />

        </LinearLayout>

        <LinearLayout
            android:id="@+id/viewB"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="0.4"
            android:orientation="vertical"
            android:padding="8dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingLeft="5dp">

                <TextView
                    android:id="@+id/index_title"
                    style="@style/reference_index"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:text="@string/title_film" />

                <TextView
                    android:id="@+id/original_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:textColor="@color/title_color"
                    android:textSize="20dp" />

            </LinearLayout>

            <View style="@style/separator" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingLeft="5dp">

                <TextView
                    style="@style/reference_index"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/genres_film" />

                <TextView
                    android:id="@+id/genres_film"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"/>


            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingLeft="5dp"
                android:paddingTop="8dp">

                <TextView
                    style="@style/reference_index"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/date_release_film" />

                <TextView
                    android:id="@+id/date_release_film"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"/>

                <TextView
                    style="@style/reference_index"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="35dp"
                    android:layout_marginStart="35dp"
                    android:text="@string/duration_film" />

                <TextView
                    android:id="@+id/duration_film"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp" />

            </LinearLayout>

            <View style="@style/separator" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingTop="10dp">

                <TextView
                    style="@style/reference_index"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:text="@string/overview_film" />

            </LinearLayout>

                <ScrollView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical" >

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent">

                    <TextView
                        android:id="@+id/overview_film"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:textSize="15sp"
                        android:layout_marginTop="5dp"
                        android:textStyle="italic" />

                    </LinearLayout>

                </ScrollView>

            </LinearLayout>

        </LinearLayout>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="16dp"
        android:backgroundTint="@color/light_azure"
        android:clickable="true"
        android:src="@drawable/ic_star_rate_black_18dp"
        app:layout_anchor="@id/viewA"
        app:layout_anchorGravity="bottom|right|end" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="20dp">

        <ImageView
            android:id="@+id/enlarged_image"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    </LinearLayout>

</android.support.design.widget.CoordinatorLayout>