图像未在ImageView中设置

时间:2016-03-09 14:17:08

标签: java android android-imageview picasso

通过链接传来的图像未在ImageView(毕加索)中设置。我已经登录了。我正在接收链接,但是当我打电话时

Picasso.with(SignAgreement.this).load(sign_url).into(img_set_sign);

图像未在ImageView中设置。

我附加了XML代码和JAVA代码: -

signature.xml中

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#e6e6e6">

    <RelativeLayout
        android:id="@+id/rltv_hdr"
        android:layout_width="fill_parent"
        android:layout_height="@dimen/capture_sign_LayoutHeight"
        android:layout_alignParentTop="true"
        android:background="@drawable/header_bg">

        <TextView
            android:id="@+id/search_header"
            style="@style/header_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:text="@string/dashboard"
            android:textColor="@android:color/white"
            android:textStyle="bold" />

        <ImageButton
            android:id="@+id/btn_back"
            android:layout_width="@dimen/capture_sign_btn_back_LayoutWidth"
            android:layout_height="@dimen/capture_sign_btn_back_LayoutHeight"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:layout_marginLeft="@dimen/capture_sign_btn_back_MarginLeft"
            android:background="@drawable/back_button" />
    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/rltv_agrmnt"
        android:layout_width="fill_parent"
        android:layout_height="250dp"
        android:layout_below="@+id/rltv_hdr"
        android:layout_centerHorizontal="true"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="@dimen/capture_sign_rltv_agrmnt_MarginTop">

        <ScrollView
            android:id="@+id/scrl_vw_cstmr_agrmnt"
            android:layout_width="fill_parent"
            android:layout_height="@dimen/capture_sign_scrl_vw_cstmr_agrmnt_LayoutHeight"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="@dimen/capture_sign_scrl_vw_cstmr_agrmnt_MarginTop"
            android:background="#e6e6e6"
            android:visibility="gone">

            <TextView
                android:id="@+id/txt_agrmnt"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:background="#e6e6e6"
                android:textColor="#000000" />
        </ScrollView>

        <WebView
            android:id="@+id/wb_vw_invoice"
            android:layout_width="fill_parent"
            android:layout_height="250dp" />

        <Button
            android:id="@+id/btn_zoom"
            style="?android:attr/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_marginBottom="@dimen/capture_sign_btn_zoom_MarginBottom"
            android:background="@android:color/darker_gray"
            android:text="Zoom"
            android:textColor="@android:color/holo_red_dark" />
    </RelativeLayout>

    <TextView
        android:id="@+id/txt2"
        android:layout_width="fill_parent"
        android:layout_height="@dimen/capture_sign_txt2_LayoutHeight"
        android:layout_alignLeft="@+id/rltv_agrmnt"
        android:layout_alignRight="@+id/rltv_agrmnt"
        android:layout_below="@+id/rltv_agrmnt"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="@dimen/capture_sign_txt2_MarginTop"
        android:background="#aaaaaa"
        android:gravity="center"
        android:text="Customer Signature"
        android:textColor="#000000" />

    <LinearLayout
        android:id="@+id/ln_signature"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@+id/img_btn_vw_clr"
        android:layout_alignLeft="@+id/txt2"
        android:layout_alignRight="@+id/txt2"
        android:layout_below="@+id/txt2"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="@dimen/capture_sign_ln_signature_MarginTop"
        android:background="#ffffff"
        android:clickable="true"
        android:orientation="horizontal"
        android:visibility="visible" />

    <ImageView
        android:id="@+id/img_set_sign"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@+id/img_btn_vw_clr"
        android:layout_alignLeft="@+id/txt2"
        android:layout_alignRight="@+id/txt2"
        android:layout_below="@+id/txt2"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="@dimen/capture_sign_ln_signature_MarginTop"
        android:background="#47ffcc"
        android:orientation="horizontal"
        android:visibility="gone" />

    <ImageButton
        android:id="@+id/img_btn_vw_clr"
        android:layout_width="@dimen/capture_sign_img_btn_vw_clr_LayoutWidth"
        android:layout_height="@dimen/capture_sign_img_btn_vw_clr_LayoutHeight"
        android:layout_above="@+id/btn_decline"
        android:layout_alignRight="@+id/ln_signature"
        android:layout_marginTop="@dimen/capture_sign_img_btn_vw_clr_MarginTop"
        android:background="@drawable/clear_signature" />

    <Button
        android:id="@+id/btn_decline"
        android:layout_width="@dimen/capture_sign_btn_decline_LayoutWidth"
        android:layout_height="@dimen/capture_sign_btn_decline_LayoutHeight"
        android:layout_above="@+id/btn_paper_sign"
        android:layout_alignRight="@+id/img_btn_vw_clr"
        android:layout_marginTop="@dimen/capture_sign_btn_decline_MarginTop"
        android:background="#ff4b25"
        android:text="Decline" />

    <Button
        android:id="@+id/btn_accept"
        android:layout_width="@dimen/capture_sign_btn_accept_LayoutWidth"
        android:layout_height="@dimen/capture_sign_btn_accept_LayoutHeight"
        android:layout_above="@+id/btn_paper_sign"
        android:layout_alignBaseline="@+id/btn_decline"
        android:layout_alignBottom="@+id/btn_decline"
        android:layout_alignLeft="@+id/ln_signature"
        android:background="#87b327"
        android:text="Accept" />

    <Button
        android:id="@+id/btn_paper_sign"
        android:layout_width="wrap_content"
        android:layout_height="@dimen/capture_sign_btn_paper_sign_LayoutHeight"
        android:layout_alignLeft="@+id/btn_accept"
        android:layout_alignParentBottom="true"
        android:layout_alignRight="@+id/btn_decline"
        android:layout_marginTop="5dp"
        android:background="#87b327"
        android:text="Signature via paper work" />

</RelativeLayout>

Signature.java

btn_yes.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                img_set_sign.setVisibility(View.VISIBLE);
                mContent.setVisibility(View.GONE);
                Picasso.with(Signature.this).load(sign_url).into(img_set_sign);
                dialog.dismiss();
            }
        });

请指导我一些指导原则 无法通过包含网址设置图片 图像到imageview

0 个答案:

没有答案