HendrixString / Android-PdfMyXml

Convert android XML layouts into PDF document, works on all versions of Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AbstractViewRenderer - render an image

rfpedrosa opened this issue · comments

Hi,

i'm following the tutorial ("How to use") section but i'm struggle to display/add an image inside a layout (i.e., ImageView). Is that possible? can you point to the right direction?

<LinearLayout

<ImageView
            android:id="@+id/iv_hello"
            android:layout_width="297px"
            android:layout_height="match_parent"
            android:background="@drawable/error_rounded_corners"
            android:src="@drawable/baselogo"
            app:srcCompat="@drawable/baselogo"/>

AbstractViewRenderer page = new AbstractViewRenderer(ctx, R.layout.page1) {

            @Override
            protected void initView(View view) {

                ImageView iv_hello = (ImageView) view.findViewById(R.id.iv_hello);
                //iv_hello.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.baselogo));
                iv_hello.setImageResource(R.drawable.baselogo);
            }
        };

What exactly is the problem?