微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何使用5个图像视图显示5个不同的签名,这些图像视图以前已使用“视图”按钮保存到图库中?

如何解决如何使用5个图像视图显示5个不同的签名,这些图像视图以前已使用“视图”按钮保存到图库中?

enter image description here我正在构建一个可以保存到图库的签名应用程序。 我想按顺序显示签名。将签名保存到图库后,立即显示在可用的图像视图上。我在下面有5张图片

这是我的代码 Signature.java

public void OnViewSignatureClick(View view) {
                ImageView tampilin = (ImageView) findViewById(R.id.imgvwSignature);
                Uri filePath = Uri.parse(path_image);

                try {
                    //Getting the Bitmap from gallery
                    bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(),filePath);
                } catch (IOException e) {
                    e.printstacktrace();
                }
                tampilin.setimageBitmap(bitmap);
            }

XML

<LinearLayout
        android:id="@+id/LinLay01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center|top">

    <ImageView
        android:id="@+id/imgvwSignature"
        android:layout_width="65dp"
        android:layout_height="65dp"
        android:background="#ccc"
        android:layout_margin="5dp"
        android:layout_weight="1"/>

        <ImageView
        android:id="@+id/imgvwSignature0"
        android:layout_width="65dp"
        android:layout_height="65dp"
        android:background="#ccc"
        android:layout_margin="5dp"
        android:layout_weight="1"/>
        <ImageView
            android:id="@+id/imgvwSignature1"
            android:layout_width="65dp"
            android:layout_height="65dp"
            android:background="#ccc"
            android:layout_margin="5dp"
            android:layout_weight="1"/>
        <ImageView
            android:id="@+id/imgvwSignature2"
            android:layout_width="65dp"
            android:layout_height="65dp"
            android:background="#ccc"
            android:layout_margin="5dp"
            android:layout_weight="1"/>
        <ImageView
            android:id="@+id/imgvwSignature3"
            android:layout_width="65dp"
            android:layout_height="65dp"
            android:background="#ccc"
            android:layout_margin="5dp"
            android:layout_weight="1"/>

    </LinearLayout>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。